tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <d...@cornell.edu>
Subject Re: deploy simple HTTP doPost servlet to tomcat 5.0.28
Date Fri, 01 Oct 2004 15:26:44 GMT
Your folder structure doesn't look right -- no WEB-INF folder.  You 
might want to take a look at the servlet specification or a good book on 
tomcat.  Think of a structure like this:

$CATALINA_HOME  (essentially the top of the Tomcat install directory)
  - config
  - server
  - common
  - shared
  - logs     (... you get the idea.  These folders are already present)
  - webapps
    - (folder named after your webapp's context)   <-- *top of your code 
here*
      - (some .jsp stuff / static resources)
      - WEB-INF
        - classes
          - (your classes here in a standard java package hierarchy)
        - lib
          - (supporting .jar files here)
        - web.xml

-- David

Christian Ruediger wrote:

>Hi folks,
>after trying the complex aproach without any success, I started a
>lowtech approach. I simply want a small servlet deployed. Can't be too
>complicated.
>
>What I have:
>Apache Tomcat 5.0.28 Server
>Win 2000
>j2sdk1.4.2_05
>
>I constructed the following structure in tomcats webapp folder:
>
>webapp -
>   - classes
>       - testserveur
>           - XML_RPC_Servlet.class
>   - libs
>   - web.xml
>
>(dont bother the name XML_RPC_Servlet.its for future purposes.
>currently only text is displayed -> see code below)
>
>web.xml is as follows:
>
><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//
>DTD WebApplication 2.2//EN"
>"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
>
><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>    version="2.4">
>    
><display-name>Testservlet</display-name>
><context-parameter>
><param-name>Lieblingsfarbe</param-name>
><param-value>rot</param-value>
></context-parameter>	
>    <servlet>
>      <servlet-name>XML_RPC_Testserveur</servlet-name>
>      <servlet-class>
>        testserveur.RPC_XML_Servlet
>      </servlet-class>
>    </servlet>
>    <servlet-mapping>
>      <servlet-name>XML_RPC_Testserveur</servlet-name>
>      <url-pattern>/XML_RPC_Testserveur</url-pattern>
>    </servlet-mapping>
></web-app>
>
>code is as follows:
>
>public class XML_RPC_Servlet extends HttpServlet{
>
>    
>
>        protected void doGet(HttpServletRequest req,
>                             HttpServletResponse res)
>                  throws ServletException, IOException
>       {
>         res.setContentType("text/html");
>         PrintWriter out = res.getWriter();
>         out.println("<HTML><HEAD><TITLE>Hello There!</TITLE>"+
>                     "</HEAD><BODY>Hello There!</BODY></HTML>");
>         out.close();
>       }
>   
>    public String getServletInfo()
>       {
>         return "HelloClientServlet 1.0 by Stefan Zeiger";
>       }
>    }
>
>What i did:
>-Started Tomcat (is configured to localhost:8080)
>-opened Browser
>-typed http://localhost:8080/XML_RPC_Testserveur
>
>- got only a message that the resource is unavailable (in french):
>
>*****************************
>type Rapport d'état
>message /XML_RPC_Testserveur
>description La ressource demandée (/XML_RPC_Testserveur) n'est pas disponible.
>******************************
>
>I am searching for a reason of this for nearly a day.
>Is there anyone who can help me?
>
>Thanx Christian
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>  
>

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