wt., 9 wrz 2025 o 08:53 Zoran Avtarovski <[email protected]> napisał(a): > > Hi Guys, > > We are moving forward with our plans to migrate from Struts6/Tomcat9 to > Struts7/Tomcat11 but we've hit a few snags I was hoping someone else has > experienced and hopefully solved. > > The first and biggest issue is with Tomcat 11. The app runs as expected > but no pages are rendered and by that I mean nothing at all. Our logs > don't show any errors - we are using log4j2 with DEBUG as the ROOT level > default. The strange thing is when we run the same app on Tomcat 10.1.45 > 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 > decorator, we also tried Sitemesh 3.2.1 which made no difference. > > Web.xml is configured as below: > > <filter-mapping> > <filter-name>struts-prepare</filter-name> > <url-pattern>/*</url-pattern> > </filter-mapping> > > <filter-mapping> > <filter-name>sitemesh</filter-name> > <url-pattern>/*</url-pattern> > </filter-mapping> > > <filter-mapping> > <filter-name>struts-execute</filter-name> > <url-pattern>/*</url-pattern> > </filter-mapping> > > This is the critical issue as we want to identify the cause of the issue > and resolve rather than put it off. > > > The second issue is related to sitemesh, which the first issue may also > be. When we run the app on Tomcat 10 struts actions aren't identified in > the path attribute only the resulting jsp is. Let me explain, say we > have a test action configured in my struts.xml as such: > > <action name="testAction" class="testActionClass" method="test"> > <result>/WEB-INF/pages/testPage.jsp</result> > </action> > > If I configure sitemesh like this: > > <mapping decorator="mainDecorator.jsp"/> > <mapping path="*/testAction.action" decorator="testDecorator.jsp"/> > > The result is incorrectly decorated using the default mainDecorator, > this works correctly in our struts 6 setup which is more or less > identical, but if I change it to this: > > <mapping decorator="mainDecorator.jsp"/> > <mapping path="*/testPage.jsp" decorator="testDecorator.jsp"/> > > The page is decorated correctly. As you can imagine that's not what we > 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 > assistance would be appreciated.
Please take a look at this PR, it should help you: https://github.com/apache/struts-examples/pull/461 Just to clarify, only Sitemesh 3.2.2 supports JakartaEE so you must use this version when running Struts 7. There is an issue with providing a custom integration as basically there is no extension points in the new Sitemesh version, I reported that issue yet no luck https://github.com/sitemesh/sitemesh3/issues/141 Not sure which approach you want to achieve, but you can take a look on this issue and try to play by setting FORWARD_SERVLET_PATH to different values (action path or JSP path) https://issues.apache.org/jira/browse/WW-5463 Cheers Łukasz --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

