I have used it for creating links to an action as below. I don't have namespace here as this action is in the namespace /, which is defined in the struts.xml. You can group actions into different namespaces using the package element.

In the below example the request context is added to the url that is generated.

<a class="link" href="<s:url action='PlanList'/>">

Thanks,
Prasanth

On 3/11/25 4:19 PM, Wolfgang Knauf wrote:
Hi Nate,

about "@StrutsParameter" and POJOs: you can set the "depth" attribute. A
value of "1" means that all properties of the POJO can be set. Level 2
would set properties of classes of properties of the POJO and so on.

  @StrutsParameter(depth = 1)
  public MyPoJo getPojo() { ... }

I don't know wether there is a depth value "unlimited".

The "s:url" question has to be answered by someone else ;-)

Best regards

Wolfgang


Am 11.03.25 um 16:09 schrieb Nate Kerkhofs:
Hi,

I'm analyzing the security changes for a migration from Struts 6.3 to Struts 
7.0.

One thing I'm wondering about is the StrutsParameter annotation that now needs to be added to all getters and setters that need to be accessed from the OGNL context. We have a number of Actions where we have getters and setters for POJO objects, and sometimes those POJOs have getters and setters for nested POJO objects as well, and sometimes this goes on for quite a number of levels. Do all these getters and setters on POJO objects need that annotation as well? Or is there a way we can just annotate the Action level getters and setters and it will handle all levels, even if it is a recursive situation where the number of levels is not known at compile time?

Another question I have: do s:url tags automatically handle the namespace resolution changes? Or will we need to add an explicit namespace to all our s:url tags? I'm not even sure what's meant with a namespace in this context. Is this related to the Request Context (the first part of the url after the domain)? Or is this something different?

Kind regards,

Nate



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


Reply via email to