OK, yeah, I just noticed that when I removed the leading "/", it worked. Is this documented somewhere? I was going by what it says in the Servlet 2.4 spec, and I didn't see that mentioned in there.
Since I need to protect the resource using a security-constraint, so, I think I'm better off just using a redirect. Thanks, Jon ----- Original Message ----- From: "Ben Souther" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Friday, December 12, 2003 3:01 PM Subject: Re: Default servlet mapping not working in Tomcat 5.0.16? > The welcome file list actually has to point to a servlet mapping. > Here is mine. It works. > > > 2296 > 2297 <servlet-mapping> > 2298 <servlet-name>HrpServlet</servlet-name> > 2299 <url-pattern>/HRP</url-pattern> > 2300 </servlet-mapping> > 2301 > 2302 > 2303 <welcome-file-list id="WelcomeFileList_1"> > 2304 <welcome-file>HRP</welcome-file> > 2305 </welcome-file-list> > 2306 </web-app> > > > > > > > > > > > > > On Friday 12 December 2003 03:35 pm, Jonathan Eric Miller wrote: > > Hmmm, I just tried it by adding the following to my web.xml file but it's > > still just printing out the directory listing. > > > > <welcome-file-list> > > <welcome-file>/servlet/myservlet</welcome-file> > > </welcome-file-list> > > > > I have it working with a index.jsp with a redirect, so, I guess I'll just > > stick with that... > > > > Thanks, Jon > > > > ----- Original Message ----- > > From: "Ben Souther" <[EMAIL PROTECTED]> > > To: "Tomcat Users List" <[EMAIL PROTECTED]> > > Sent: Friday, December 12, 2003 1:31 PM > > Subject: Re: Default servlet mapping not working in Tomcat 5.0.16? > > > > > In version 5x you could also set a servlet to be your welcome file. > > > > > > On Friday 12 December 2003 01:45 pm, Shapira, Yoav wrote: > > > > Howdy, > > > > The / mapping is taken by default servlet in the default tomcat > > > > configuration. If you map a servlet to /, you have to: > > > > 1. Remove the default servlet mapping from conf/web.xml. > > > > 2. Make sure you handle static content (this is what the default > > > > servlet handles, among other duties). > > > > > > > > As for directory listings, read the FAQ. > > > > > > > > Yoav Shapira > > > > Millennium ChemInformatics > > > > > > > > >-----Original Message----- > > > > > > > > From: Jonathan Eric Miller [mailto:[EMAIL PROTECTED] > > > > > > > > >Sent: Friday, December 12, 2003 1:23 PM > > > > >To: Tomcat User List > > > > >Subject: Default servlet mapping not working in Tomcat 5.0.16? > > > > > > > > > >I'm using Tomcat 5.0.16 and I'm trying to make it so that if a user > > > > > > > > enters > > > > > > > > >a > > > > >path like, http://myserver/myapp it runs a default servlet for that > > > > > > > > path. > > > > > > > > >According the the Servlet 2.4 spec, you can do this by mapping "/" to > > > > > a servlet. However, for me, it's just printing out a directory > > > > > listing of > > > > > > > > the > > > > > > > > >/myapp directory when I try it (on a side note, how do you globally > > > > > > > > disable > > > > > > > > >directory browsing?). > > > > > > > > > >I'm using a web.xml similar to the following. > > > > > > > > > ><?xml version="1.0" encoding="ISO-8859-1"?> > > > > ><web-app xmlns="http://java.sun.com/xml/ns/j2ee" > > > > >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > > > >xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" > > > > >version="2.4"> > > > > ><servlet> > > > > ><servlet-name>myservlet</servlet-name> > > > > ><servlet-class>mypackage.MyServlet</servlet-class> > > > > ></servlet> > > > > ><servlet-mapping> > > > > ><servlet-name>myservlet</servlet-name> > > > > ><url-pattern>/</url-pattern> > > > > ><url-pattern>/servlet/myservlet</url-pattern> > > > > ><url-pattern>/servlet/myservlet/*</url-pattern> > > > > ></servlet-mapping> > > > > > > > > > >Also, I have something similar to the following in my server.xml. > > > > > > > > > ><Context path="/myapp" docBase="myapp" debug="0" reloadable="true"> > > > > > > > > > >Any ideas? > > > > > > > > > >I can do what I want to do using an index.jsp with a redirect, but, I > > > > > > > > would > > > > > > > > >like to avoid having it do a redirect if possible. > > > > > > > > > >Jon > > > > > > > > > > > > > > >--------------------------------------------------------------------- > > > > >To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > This e-mail, including any attachments, is a confidential business > > > > communication, and may contain information that is confidential, > > > > proprietary and/or privileged. This e-mail is intended only for the > > > > individual(s) to whom it is addressed, and may not be saved, copied, > > > > printed, disclosed or used by anyone else. If you are not the(an) > > > > intended > > > > > > recipient, please immediately delete this e-mail from your computer > > > > system > > > > > > and notify the sender. Thank you. > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- > > > Ben Souther > > > F.W. Davison & Company, Inc. > > > > > > > > > > > > --------------------------------------------------------------------- > > > 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] > > -- > Ben Souther > F.W. Davison & Company, Inc. > > > > --------------------------------------------------------------------- > 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]