czw., 4 sty 2024 o 12:33 Patrice DUROUX
<[email protected]> napisał(a):
> In the concerned webapp project, some JSP have code like:
>
> <script>
> ...
> var speciesData = <s:action name="species" executeResult="true" />;
> ...
> </script>
>
> And if I just replace in it <script> by <s:script> then it breaks the
> rendered page having:
>
> <script nonce="XXXXXXXXXXXXXXX">
> ...
> var speciesData = ;
> ...
> <script>
>
> In fact, the result of the tag <s:action> is no longer in its expected place
> but is elsewhere
> in the document contrary to what I thought it had been silently ignored.
>
> So after isolating such a case in a tiny project (without any plugins), it
> was not reproducible
> and the result was the one expected.
> The project is using the following Struts plugins: tiles, jquery and
> bootstrap.
>
> Could one of those implied to such an effect?
I just checked with a very basic example and it works:
<s:script>
<s:action name="test" executeResult="true" flush="false"/>
console.log(c);
</s:script>
where the action test just returns:
const a=1;
const b=2;
const c=a+b;
So I assume it has something to do with the result of: <s:action
name="species" executeResult="true" />; - I would check if there are
no \n\r characters or something else that breaks page structure.
Regards
Łukasz
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]