First, let me say SORRY! for using the dev@ list. I intended this to go to user@, but must have copied the wrong address when I started this thread.
Second, following on from my last email, it looks like if I reverse the order of the <servlet-mappings> in web.xml, things start to work. Maybe Struts is just storing the last mapping it finds at startup time, as opposed to using the actual mapping at runtime? (Glancing at addServletMapping() in ActionServlet.java makes me think this too.) So, reversing the order solves the problem, in case anyone else tries something similar. Jay -----Original Message----- From: Jay Burgess [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 4:25 PM To: dev@struts.apache.org Subject: RE: Servlet mapping in a Struts app? That probably explains it then. :) I'm still a little confused, though, as I thought that the mappings were directives for the container (Tomcat in this case), but obviously Struts also needs to get it from somewhere to build the form action URL, so this must be where it's getting messed up. I'm going to play around some more this weekend, but it may be that I end up having to call my API function ".do's" to get it to work. Thanks for the reply. Jay -----Original Message----- From: Don Brown [mailto:[EMAIL PROTECTED] Sent: Friday, March 17, 2006 4:18 PM To: Struts Developers List Subject: Re: Servlet mapping in a Struts app? Struts doesn't support multiple servlet mappings, which is probably why you are seeing some strange results. Don Jay Burgess wrote: > I must be misunderstanding something about the way servlet mapping works with > my > Struts application in Tomcat. I have two servlet mappings in web.xml: > > <servlet-mapping> > <servlet-name>action</servlet-name> > <url-pattern>*.do</url-pattern> > </servlet-mapping> > <servlet-mapping> > <servlet-name>action</servlet-name> > <url-pattern>/API/*</url-pattern> > </servlet-mapping> > > The first is for my action handlers. The second is recently added, and > represents a collection of "third party API functions" that I've implemented > (also as action handlers). However, my base application is now doing the > following. > > When I hit "https://localhost/MyApp/login.jsp" for my main app, the following > <html:form> tag in login.jsp: > > <html:form action="Login.do" focus="userId"> > > Gets turned into: > > <form name="loginForm" method="post" action="/MyApp/API/Login"> > > I'm confused as to why it's adding the "/API" to the form action, but it's got > to be related to the new <servlet-mapping>. My struts-config.xml looks like > the > following, and there's not mention of API: > > <action path="/Login" > type="com.vtgroup.controller.LoginAction" > name="loginForm" > scope="request" > validate="false" > input="/login.jsp"> > </action> > > Please enlighten me, as I feel stupid about this, but can't figure it out. > > Thanks. > > Jay > > | Jay Burgess [Vertical Technology Group] > | http://www.vtgroup.com/ > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]