tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwightHugget <jamai...@concentric.net>
Subject Re: Can't install servlets?
Date Wed, 14 May 2003 02:37:28 GMT
On Tuesday 13 May 2003 22:17, Matt Goyer wrote:
> 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

I'm no expert but here's my take.
Tomcat disables the invoker servlet, looks like you're trying to use the 
invoker servlet or sime weird combination.
If you want to use the invoker servlet then:
in conf/web.xml enable the invoker servlet
http://localhost:8080/servlet/fully.qualified.package.name.HelloWorld

Another way would be to create a servlet mapping for your servlet and then 
access via:
http://localhost:8080/webappName/mappingForServelet

-- 
Dwight Hugget
http://www.dmhEnterprise.com

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