-
1. Re: Servlet welcome-file not working
pdog4x4 Mar 15, 2006 8:43 AM (in response to treespace)treespace,
Please post all of your relevant configuration files.
Thanks!
Joshua Preston. -
2. Re: Servlet welcome-file not working
treespace Mar 15, 2006 10:39 AM (in response to treespace)Just add a servlet, with or without a servlet mapping:
<servlet-name>Navigator</servlet-name>
<servlet-class>com.acme.Navigator</servlet-class>
Try using "Navigator" as a welcome-file:
<welcome-file-list>
<welcome-file>Navigator</welcome-file>
</welcome-file-list>
If the war file is "acme" then http://localhost/acme will NOT go to the Navigator servlet. Instead the default tomcat servlet is called and you get a directory listing. -
3. Re: Servlet welcome-file not working
treespace Mar 15, 2006 5:38 PM (in response to treespace)Workaround until servlet welcome-files are fixed:
Use a static welcome file...
<welcome-file-list>index.html</welcome-file-list>
Containing the following script element...
< body>
< script type="text/javascript">window.location="/navigator"</ script >
hang on buddy...
</ body>
Add query string arguments as needed by your controller, e.g., /navigator?action=home -
4. Re: Servlet welcome-file not working
starksm64 Mar 16, 2006 4:42 AM (in response to treespace)A welcome file servlet requires a mapping like:
<welcome-file-list> <welcome-file>WelcomeServlet</welcome-file> </welcome-file-list> <servlet> <servlet-name>WelcomeServlet</servlet-name> <servlet-class>...</servlet-class> </servlet> <servlet-mapping> <servlet-name>WelcomeServlet</servlet-name> <uri-pattern>*.welcome</uri-pattern> </servlet-mapping>
and a matching (can be empty since its ignored) static file such my.welcome under each path where the welcome servlet is to be invoked. -
5. Re: Servlet welcome-file not working
treespace Mar 19, 2006 8:29 PM (in response to treespace)I did not see any mention of a dummy static welcome file mapping in the 2.4 servlet specfiication. Whatever works I suppose. I think I will stick with the bona fide static welcome file that sets the window location. That also works.
Thanks for the feedbackScott.