You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andreas Sachs <an...@gmx.de.INVALID> on 2023/12/16 16:03:19 UTC

Add context to CspInterceptor reportUri

Hello,
i'm using the CspInterceptor and want to add a reportUri. The destination is an action defined in my application.

To set the reportUri in struts.xml i have to specify the complete url (with context).

<param name="reportUri">/context/report.action</param>

Is there a parameter to get the context?

<param name="reportUri">/????/report.action</param>


Thanks
Andi



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Add context to CspInterceptor reportUri

Posted by Lukasz Lenart <lu...@apache.org>.
sob., 16 gru 2023 o 17:04 Andreas Sachs <an...@gmx.de.invalid> napisał(a):
>
> Hello,
> i'm using the CspInterceptor and want to add a reportUri. The destination is an action defined in my application.
>
> To set the reportUri in struts.xml i have to specify the complete url (with context).
>
> <param name="reportUri">/context/report.action</param>
>
> Is there a parameter to get the context?
>
> <param name="reportUri">/????/report.action</param>

Good question, I think right now I don't see any other option than
using "CspSettingsAware" interface and setting everything via action.

To have this work during action processing the interceptor must be
marked with "WithLazyParams" [1] - in other case the params are
populated during instating the interceptor
[1] https://struts.apache.org/core-developers/interceptors#lazy-parameters


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org