tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Orr <Nicholas....@mim.com.au>
Subject RE: Can't install servlets?
Date Wed, 14 May 2003 02:41:03 GMT
Reasons:
1. the default servlet mapper has not been put back in as it is now taken
out due to a security bug
2. you need to use the full package name when using /servlets/* - so your
would be
http://localhost:8080/erecs/servlet/com.transpose.erecs.servlets.HelloWorld
3. just put in your web.xml a servlet-mapping parameter like this

  <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>/helloworld</url-pattern>
  </servlet-mapping>

Then get to it using this url - http://localhost:8080/erecs/helloworld

Hope this helps :)

Nicholas Orr

-----Original Message-----
From: Matt Goyer [mailto:mgoyer@uwaterloo.ca] 
Sent: Wednesday, 14 May 2003 12:17 PM
To: tomcat-user@jakarta.apache.org
Subject: Can't install servlets?


Have I gone crazy? I'm using Tomcat 4.1.24 and can't install any servlets
(though the default examples work).

Here is my HelloWorld test that doesn't work:

Web.xml:

<!DOCTYPE web-app 
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
	<servlet>
		<servlet-name>HelloWorld</servlet-name>
	
<servlet-class>com.transpose.erecs.servlets.HelloWorld</servlet-class>
	</servlet>
</web-app

HelloWorld.java:

package com.transpose.erecs.servlets;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class HelloWorld
	extends HttpServlet
{

	public void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
		doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
		PrintWriter out;
		response.setContentType("text/html");
		out = response.getWriter();
		out.println("HelloWrold");
	}

But yet I'm getting nothing at
http://localhost:8080/erecs/servlet/HelloWorld. I also don't see anything
weird in the log files.

Thanks,
Matt


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


**********************************************************************
The information contained in this e-mail is confidential and is
intended only for the use of the addressee(s).
If you receive this e-mail in error, any use, distribution or
copying of this e-mail is not permitted. You are requested to
forward unwanted e-mail and address any problems to the
MIM Holdings Limited Support Centre.
For general enquires:	++61 7 3833 8000
Support Centre e-mail:	supportcentre@mim.com.au
Support Centre phone:  	Australia 1800500646
        				International ++61 7 38338042
**********************************************************************


---------------------------------------------------------------------
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