tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Wickson" <a...@awtech.co.uk>
Subject (simple?) servlet context problem
Date Wed, 23 Oct 2002 12:56:05 GMT
 Hi all,

I am using TC 4.1.12 on Win2K as it came, with invoker servlet commented out in the %CATALINA_HOME%\conf\web.xml
file.

I have the following added to the %CATALINA_HOME%\conf\server.xml file:       
<Context path="/greeting" docBase="greeting"  debug="0" reloadable="true" crossContext="true"/>

I have the following web app files:
%CATALINA_HOME%\webapps\greeting\index.html
%CATALINA_HOME%\webapps\greeting\WEB-INF\classes\GreetingServlet.class
%CATALINA_HOME%\webapps\greeting\WEB-INF\web.xml

The web.xml file looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
  <servlet>
    <!-- Servlet alias -->
    <servlet-name>GreetingServlet</servlet-name>

    <!-- Fully qualified Servlet class-->
    <servlet-class>GreetingServlet</servlet-class>
  </servlet>
    <servlet-mapping>
    <servlet-name>GreetingServlet</servlet-name>
     <url-pattern>/GreetingServlet</url-pattern> 
    </servlet-mapping>
</web-app>

The URL http://localhost:8080/greeting/index.html serves up the html page correctly and this
page tries to invoke the GreetingServlet but the response is trying to use the servlet context
as can be seen from the URL in the following error page message.

The requested resource (/greeting/servlet/GreetingServlet) is not available.

Does anyone know how /servlet/ got into the response URL?

Regards

Andy Wickson

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message