Struts 7 Migration Issues
Zoran Avtarovski <[email protected]> Tue, 9 Sep 2025 16:51:58 +1000
| Newsgroups | gmane.comp.jakarta.struts.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Guys, We are moving forward with our plans to migrate from Struts6/Tomcat9 to=20 Struts7/Tomcat11 but we've hit a few snags I was hoping someone else has=20 experienced and hopefully solved. The first and biggest issue is with Tomcat 11. The app runs as expected=20 but no pages are rendered and by that I mean nothing at all. Our logs=20 don't show any errors - we are using log4j2 with DEBUG as the ROOT level=20 default. The strange thing is when we run the same app on Tomcat 10.1.45=20 it works as expected, except for one possibly related issue. We are using struts 7.0.3 with Tomcat 11.0.10 and Sitemesh 3.2.2 as our=20 decorator, we also tried Sitemesh 3.2.1 which made no difference. Web.xml is configured as below: <filter-mapping> =C2=A0 =C2=A0 =C2=A0 =C2=A0 <filter-name>struts-prepare</filter-name> =C2=A0 =C2=A0 =C2=A0 =C2=A0 <url-pattern>/*</url-pattern> =C2=A0 =C2=A0 </filter-mapping> =C2=A0 =C2=A0 <filter-mapping> =C2=A0 =C2=A0 =C2=A0 =C2=A0 <filter-name>sitemesh</filter-name> =C2=A0 =C2=A0 =C2=A0 =C2=A0 <url-pattern>/*</url-pattern> =C2=A0 =C2=A0 </filter-mapping> =C2=A0 =C2=A0 <filter-mapping> =C2=A0 =C2=A0 =C2=A0 =C2=A0 <filter-name>struts-execute</filter-name> =C2=A0 =C2=A0 =C2=A0 =C2=A0 <url-pattern>/*</url-pattern> =C2=A0 =C2=A0 </filter-mapping> This is the critical issue as we want to identify the cause of the issue=20 and resolve rather than put it off. The second issue is related to sitemesh, which the first issue may also=20 be. When we run the app on Tomcat 10 struts actions aren't identified in=20 the path attribute only the resulting jsp is. Let me explain, say we=20 have a test action configured in my struts.xml as such: <action name=3D"testAction" class=3D"testActionClass" method=3D"test"> =C2=A0 =C2=A0 =C2=A0<result>/WEB-INF/pages/testPage.jsp</result> </action> If I configure sitemesh like this: <mapping decorator=3D"mainDecorator.jsp"/> <mapping path=3D"*/testAction.action" decorator=3D"testDecorator.jsp"/> The result is incorrectly decorated using the default mainDecorator,=20 this works correctly in our struts 6 setup which is more or less=20 identical, but if I change it to this: <mapping decorator=3D"mainDecorator.jsp"/> <mapping path=3D"*/testPage.jsp" decorator=3D"testDecorator.jsp"/> The page is decorated correctly. As you can imagine that's not what we=20 want. Mapping to the actions is a far more elegant and manageable. The documentation for sitemesh is a bit thin on their site so any=20 assistance would be appreciated. Zoran