Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #29317

A question for deploying servlet to tomcat using the whole directory?

Newsgroups comp.lang.java.programmer
Date 2014-07-25 09:00 -0700
Message-ID <de365efe-66bb-4f22-a365-8f2586e2fe31@googlegroups.com> (permalink)
Subject A question for deploying servlet to tomcat using the whole directory?
From www <xsli2@yahoo.com>

Show all headers | View raw


I am learning servlet and Context information. I can deploy my WAR file(/aa/bb/MyServlet.war) --on linux, to tomcat this way:

in the directory apache-tomcat-8.0.9/conf/Catalina/localhost, add the context file "hello.xml" with the content:
<Context docBase="/aa/bb/MyServlet.war" reloadable="true"/>

(The tomcat server is already running when I am doing this). The URL "http://localhost:8080/hello/my" works. ("my" is mapped in web.xml)

However, if I don't want to use WAR, I just want to use the whole servlet directory created by Eclipse:

/xx/yy/HelloWorldServlet
$tree
.
|-- WebContent
|   |-- META-INF
|   |   `-- MANIFEST.MF
|   |-- WEB-INF
|   |   |-- lib
|   |   `-- web.xml
|   `-- greeting.jsp
|-- build
|   `-- classes
|       `-- firsttry
|           `-- MyFirstServlet.class
`-- src
    `-- firsttry
        `-- MyFirstServlet.java

I try it in modifying the context file "hello.xml" mentioned above:

<Context docBase="/xx/yy/HelloWorldServlet/" reloadable="true"/>

The URL won't work. How can I make it work?

Thank you.

Back to comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread


Thread

A question for deploying servlet to tomcat using the whole directory? www <xsli2@yahoo.com> - 2014-07-25 09:00 -0700

csiph-web