wt., 11 mar 2025 o 16:09 Nate Kerkhofs <nate.kerkh...@ikan.be> napisał(a): > 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?
You just need one @StrutsParametere annotation with "depth" attribute set to a proper value or Integer.MAX_VALUE for a given setter (once defined for setter, there is no need to define another for getter) https://github.com/apache/struts-examples/blob/main/type-conversion/src/main/java/org/apache/struts/example/ThemeAction.java#L47-L57 > 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? In Struts you can define packages in different namespaces, this is something different the Request Context, basically all the actions from a given package are available in a given namespace (do not treat namespace as folder, just a named space, eg. /admin/users or /public/orders) https://struts.apache.org/core-developers/namespace-configuration And by default <s:url/> tag uses the current namespace where you use it, yet you can define the "namespace" attribute if you want to create a link to action in another namespace. https://struts.apache.org/tag-developers/url-tag Cheers Łukasz --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org