All you need to do is add a "welcome file" element in web.xml that points the user at your login action:
<welcome-file> <welcome-file>welcome.do</welcome-file> </welcome-file> This won't work in Tomcat 4, but does work in Tomcat 5. (NOTE: if you're using Servlet 2.3 or earlier format for your web.xml file, the order of the elements is defined in the DTD; for Servlet 2.4 or later you can have them in any order). Craig On Thu, 14 Oct 2004 14:38:55 -0600, Kevin Clifton <[EMAIL PROTECTED]> wrote: > Hello all. I'm just looking for a quick sanity check before I go off > to build some pieces.... > > I'm building out a webapp that will use Struts with Tomcat 5.0.2x. I'm > planning to run everything under Tomcat and avoid deploying Apache for > handling static content. > > I've prototyped a signup module for the app, and I'm experimenting > with the behaviour of the module. Currently, the module is at a URL of > localhost/<servercontext>/signup, and the initial action is setup as > "welcome.do". So to signup, a user would go to > localhost/webapp/signup/welcome.do. > > Testing this, I entered localhost/webapp/signup as a URL, and Tomcat > came back with a directory listing. I can disable that in web.xml, but > then that URL comes back as 404. I tried putting a file named > index.jsp (which is set up as a welcome file in web.xml) in the > directory, but I still got a directory listing. > > What I'd like to do is have the incomplete URL automatically append > the "welcome.do" and forward the user to the start of the signup > module. Ideally, I'd set this up as a pattern for every module in the > app. > > I'm thinking the best way to do this is to extend > org.apache.catalina.servlets.DefaultServlet to simply append > "welcome.do" when the URL doesn't include an action, and then let > Struts handle everything from there. But before I go do that, I want > to make sure I'm not missing an easier alternative, either by changing > my action mapping patterns or pulling some other Struts and/or Tomcat trick. > > Any and all advice gratefully accepted! > > Thanks, > Kev > > --------------------------------------------------------------------- > 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]