Re: Questions about migrating to Struts 7.0
czw., 3 kwi 2025 o 12:24 Shivam Agrahari napisał(a): > I have enabled dev mode and also log level to debug but there is no error > being displayed. Hard to guess with having no information from your side. Could you post your action with annotation on setters? Regards Łukasz - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: Questions about migrating to Struts 7.0
Hi, I have enabled dev mode and also log level to debug but there is no error being displayed. Regards, Shivam On Wed, Apr 2, 2025 at 4:29 PM Lukasz Lenart wrote: > śr., 2 kwi 2025 o 12:29 Shivam Agrahari > napisał(a): > > I am in the process of upgrading a Java application from Struts 6.7.4 to > > Struts 7.0.3. I've made the necessary changes as per the migration guide, > > such as updating javax to jakarta. However, when I submit the user ID and > > password, they are not being accessed in the action class. Additionally, > I > > have used the @StrutsParameter annotation on every setter in the bean > > class. Could you please suggest any necessary changes to resolve this > issue? > > I would suggest increasing log level to debug and enabling devMode - > running locally should show some warnings. Also take a look on > allowlist capability as may need to expose some classes/packages > > https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=293046977#Struts6.x.xto7.x.xmigration-OGNLallowlistcapability > > > Cheers > Łukasz > > - > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
Re: Questions about migrating to Struts 7.0
śr., 2 kwi 2025 o 12:29 Shivam Agrahari napisał(a): > I am in the process of upgrading a Java application from Struts 6.7.4 to > Struts 7.0.3. I've made the necessary changes as per the migration guide, > such as updating javax to jakarta. However, when I submit the user ID and > password, they are not being accessed in the action class. Additionally, I > have used the @StrutsParameter annotation on every setter in the bean > class. Could you please suggest any necessary changes to resolve this issue? I would suggest increasing log level to debug and enabling devMode - running locally should show some warnings. Also take a look on allowlist capability as may need to expose some classes/packages https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=293046977#Struts6.x.xto7.x.xmigration-OGNLallowlistcapability Cheers Łukasz - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: Questions about migrating to Struts 7.0
Hi, I am in the process of upgrading a Java application from Struts 6.7.4 to Struts 7.0.3. I've made the necessary changes as per the migration guide, such as updating javax to jakarta. However, when I submit the user ID and password, they are not being accessed in the action class. Additionally, I have used the @StrutsParameter annotation on every setter in the bean class. Could you please suggest any necessary changes to resolve this issue? Regards, Shivam On Wed, Mar 12, 2025 at 11:23 AM Lukasz Lenart wrote: > wt., 11 mar 2025 o 16:09 Nate Kerkhofs 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 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: [email protected] > For additional commands, e-mail: [email protected] > >
Re: Questions about migrating to Struts 7.0
wt., 11 mar 2025 o 16:09 Nate Kerkhofs 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 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: [email protected] For additional commands, e-mail: [email protected]
Re: Questions about migrating to Struts 7.0
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.
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: [email protected]
For additional commands, e-mail: [email protected]
Re: Questions about migrating to Struts 7.0
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: [email protected]
For additional commands, e-mail: [email protected]

