tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Huang <Denn...@datacom.com.au>
Subject RE: Servlet problem solved.
Date Mon, 04 Sep 2000 22:41:13 GMT
Hi, Mark:

Thank you for your message.

I have no problem if context is 'examples'. If the context is something else
that I created, f.ex. 'myapps', then my servlet doesn't work
(http://localhost:8080/myapps/servlet/HelloWorldExample doesn't work). Have
you tried this?

In the end of your email : 

'notice that there is a locale properties file that
is also needed, or you will get an error'

Can you please show me the file? maybe this is where I can't get my servlet
working.


Thanks,


Dennis

-----Original Message-----
From: J. Mark Brooks [mailto:jmbrooks@bigfoot.com]
Sent: Tuesday, September 05, 2000 12:47 AM
To: tomcat-user@jakarta.apache.org
Subject: Servlet problem solved.


Just in case anyone else sees my messages regarding problems running
servlets, Simon helped me out, and the problem is solved.

To summarize, you can run any servlet directly using the default
Tomcat setup if your servlet is compiled in the /WEB-INF/classes directory
of your application root directory (for the examples directory, 
this was/is webapps/examples/WEB-INF/classes) and you invoke it using
<application root directory>/servlet/<servlet-name>.  For example:

http://localhost:8080/examples/servlet/SimpleServlet

will run the SimpleServlet provided in the Tomcat examples directly.
Note that this is a virtual mapping -- you do NOT need a servlets
directory to do this.  If you will look at web.xml in the /conf directory
of your Tomcat install, you will see the default invoker routine that
has set this up.

Also, for those of us (guilty) that tried to figure this out by
copying HelloWorldExample.class outside of the examples setup to
our own directory, notice that there is a locale properties file that
is also needed, or you will get an error.  Neglected to read the source
and see that something a little extra was going on.

-- 
---------------------------------------
J. Mark Brooks
Sun Certified Programmer for Java 2
http://www.uncg.edu/~jmbrook2

Mime
View raw message