tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brad Taylor" <btay...@western-metal-supply.com>
Subject How do I make my servlet the welcome page
Date Wed, 01 Sep 2004 19:16:49 GMT
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 the
"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 mypage.do
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" ?>
<web-app>
  <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">
<html>
  <head>
  <meta http-equiv="refresh" content="0;url=mypage.do"/>
    <title>My page</title>
  </head>
  <body>
   Redirecting to actual navigation page
  </body>
</html>

Any help appreciated


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message