Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

RE: Re: What, exactly, is meant by "full path" when construction  
 web.xml entries

cknell

2006-03-20

Replies:

Thanks for the sanity check. That did what I expected, so to expand on this, if I were creating a "real" servlet whose source code opened like this:

package com.kilonovember.Monkey;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class Monkey extends HttpServlet{

.. programming stuff goes here ...

}

I would create this directory structure under "C:\Apache Software Foundation\Tomcat 5.5\webapps"?

com/kilonovember

and place my compiled Monkey.class in kilonovember?

Next I would edit the web.xml file and add these elements?

  <servlet>
    <servlet-name>monkey</servlet-name>
    <servlet-class>com.kilonovember.Monkey</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>monkey</servlet-name>
    <url-pattern>/monkey</url-pattern>
  </servlet-mapping>

Having done that, I would re-start Tomcat and, providing my Monkey.class compiled correctly, I should expect to be able to type "http://localhost:8080/monkey" into my browser's address window and see the output of Monkey.class. Is that correct?


Thanks to everyone who responded.
--
Charles Knell
cknell@(protected)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.