Using an action URI for web.xml declarative security results in a 404 "The requested resource (/mywebapp/login.action) is not available message." on Tomcat (both 5.5.x & 6.x). Representative XML configs below:
Unfortunately it looks like the S2 architectural change from a Servlet to Servlet Filters is the culprit. After digging through the tomcat 5.5.23 (also present in the most recent 6.0.13 release) code I've come to the conclusion Struts2 actions CAN NOT be used for any of the common web.xml descriptor elements (form-login-page, form-error-page, welcome-file?, other?). Here's a snippet of the javadoc from org.apache.catalina.core.ApplicationDispatcher's invoke method:
- <strong>IMPLEMENTATION NOTE</strong>: This implementation assumes that no filters are applied to a forwarded or included resource, because they were already done for the original request.
Since this worked in S1, I've opened this ticket as a BUG. The workaround I received on the user list of doing an HTTP meta REFRESH works, but results in screen flashing (even with a refresh of 0 seconds) and a poor user experience. I'd GREATLY appreciate if one of the Struts developers had a more elegant workaround suggestion. For example would it be feasible to port FilterDispatcher to a servlet?