Unfortunately it looks like the Struts 2 architectural change is the culprit after all. 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 S2 is based on a Filter (org.apache.struts2.dispatcher.FilterDispatcher) the container doesn't attempt to invoke the MVC framework. This is a major bummer to say the least. I'm not sure if the tomcat implementation of the servlet spec is flawed, if there's a gap in the servlet spec or what. I am surprised I'm the first S2 user to run into this. I'd GREATLY appreciate if one of the Tomcat developers monitoring this list could comment on the current implementation of ApplicationDispatcher.invoke and possibly suggest a workaround. For example would it be feasible to plug-in a subclass of org.apache.catalina.core.ApplicationDispatcher that had an invoke method that always executed the filter chain even if the servlet was null? Thanks, Jon ----- Original Message ---- From: Jon Wilmoth <[EMAIL PROTECTED]> To: Tomcat Users List <users@tomcat.apache.org> Sent: Monday, June 25, 2007 7:27:29 PM Subject: Re: Dynamic form-login-page? To add some more context to this, I was able to successfully use a Struts 1.x action in my web.xml. Struts 1 was based on a servlet vs the ServletFilter that Struts 2.x is based on. Is there anything about this architectural change that would require a different Tomcat configuration? The default extension for struts also changed from .do to .action. Is there anything about this that requires a special Tomcat configuration for form-login-pages that are handled by Struts2? Any help or working examples of a S2 app deployed on Tomcat 5.5.x or 6.x is greatly appreciated! ----- Original Message ---- From: Jon Wilmoth <[EMAIL PROTECTED]> To: users@tomcat.apache.org Sent: Monday, June 25, 2007 2:43:45 PM Subject: Dynamic form-login-page? I'm having problems using FORM authentication and a dynamic login page via Struts 2. I've tried the following web.xml/struts.xml entries with S2.0.8 & Tomcat 5.5.23, but get a 404 "The requested resource (/mywebapp/login.action) is not available" message. <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/login.action</form-login-page> <form-error-page>/loginFailure.action</form-error-page> </form-login-config> </login-config> <action name="login"> <result>/login.jsp</result> </action> The login action loads the login.jsp just fine when called directly, but doesn't work when invoked by the servlet container. Instead I see the following in the Tomcat log: Jun-25-2007 10:31:30:865 AM, PDT [DEBUG] (org.apache.catalina.authenticator.FormAuthenticator) - Save request in session '930B154E1AD9BFB1283165CD888441EF' Jun-25-2007 10:31:33:053 AM, PDT [DEBUG] (org.apache.catalina.core.ApplicationDispatcher) - servletPath=/login.action, pathInfo=null, queryString=null, name=null Jun-25-2007 10:31:33:053 AM, PDT [DEBUG] (org.apache.catalina.core.ApplicationDispatcher) - Path Based Forward Jun-25-2007 10:31:33:053 AM, PDT [DEBUG] (org.apache.catalina.core.ApplicationDispatcher) - Disabling the response for futher output I've asked on the Struts2 list if this should be possible to do and the response I got was it definitely should work. I'm wondering if there's a special Tomcat configuration (beyond my webapp's web.xml struts2 filter mapping) I need to add to enable a .action extension being used for form-authentication. Thanks, Jon --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]