tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: How do I make my servlet the welcome page
Date Wed, 01 Sep 2004 19:22:45 GMT

I hope ui.html is a directory and not a file, because otherwise your
Context docBase is invalid.

Specify a DTD (or schema) for your web.xml, and make sure it's valid
according to that DTD (or schema).  For example, in the 2.3 servlet spec
DTD, welcome-file-list can only come after servlets and servlet

You will need to define the servlet as a servlet tag, map it, and put a
welcome file entry for the servlet mapping.

Yoav Shapira
Millennium Research Informatics

>-----Original Message-----
>From: Brad Taylor []
>Sent: Wednesday, September 01, 2004 3:17 PM
>Subject: How do I make my servlet the welcome page
>I am running tomcat 5.0.9.  I currently enter a url like
>http://localhost:8080/myapp.  This causes a "redirect" page to be
>briefly displayed followed by my servlet getting invoked and serving
>"real" page.  I would like to bypass this redirect, but can not seem to
>get it to work.  I have tried changing my welcome-file-list to
>and I have tried creating a servlet-mapping specifying index.html.
>Content of ....\conf\Catalina\localhost\myapp.xml
><Context path="/myapp"
>    docBase="C:\eclipse\workspace\com.mycom\myapp\ui.html"
>    debug="0"
>    privileged="true"/>
>Index.html exists in the above directory
>This is the essential contents of WEB-INF\web.xm in above directory
><?xml version="1.0" encoding="ISO-8859-1" ?>
>  <display-name>Myapp</display-name>
>  <description>Myapp desc</description>
>  <welcome-file-list>index.html</welcome-file-list>
>  <!--
>  Define myservlet
>  -->
>  <servlet>
>    <servlet-name>myapp</servlet-name>
>    <servlet-class>com.myapp.ui.MyServlet</servlet-class>
>    <load-on-startup>1</load-on-startup>
>  </servlet>
>  <servlet-mapping>
>    <servlet-name>myapp</servlet-name>
>    <url-pattern>*.do</url-pattern>
>  </servlet-mapping>
>Contents of index.html
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>  <head>
>  <meta http-equiv="refresh" content="0;"/>
>    <title>My page</title>
>  </head>
>  <body>
>   Redirecting to actual navigation page
>  </body>
>Any help appreciated
>To unsubscribe, e-mail:
>For additional commands, e-mail:

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:
For additional commands, e-mail:

View raw message