Originally posted by William Brogden:
Place your servlet in a package, use that package name in the servlet declaration in web.xml and place the compile class under WEB-INF\classes accordingly.
All Java classes used in servlets should be in packages - it will save you lots of grief to just do it that way.
Bill
Originally posted by Ben Souther:
Is this up on a hosted server?
If so, the first thing I would do is put a simple html page in the 'dean' directory and see I can hit it.
Also, for the record, I agree with William and others here.
There is never a good reason not to package a Java class.
In a serlvet app, there are particular cases where you can get away with it and cases where you can't.
It's a complete waste of your brain's CPU cycles to try to learn when you can and can't.
Just package everything.
That being said, I don't think packaging is the problem in this case.
Originally posted by Ben Souther:
Your directory structure (under WEB-INF) has to match your package structure.
For instance if my servlet were in package us.souther, then its class file would need to be under WEB-INF/classes/us/souther.
Your references to that class file in your deployment descriptor (web.xml) will also need to be fully qualified.
<servlet-class>us.souther.MyServlet</servlet-class>
Also, you've only implemented the doPost method.
You'll need to implement the doGet method if you want to access it directly from a hyperlink or by typing the address into your browser's window.
[ December 28, 2006: Message edited by: Ben Souther ]
I'm not really familiar with Tomcat, but shouldn't there be a "/dean/" somewhere in there? Or are you deploying the compiled classes into a path that does have "/dean/" in it?I compiled it in the directory of /usr/local/tomcat/webapps/WEB-INF/classes...
Originally posted by Paul Clapham:
I'm not really familiar with Tomcat, but shouldn't there be a "/dean/" somewhere in there? Or are you deploying the compiled classes into a path that does have "/dean/" in it?
Originally posted by Ben Souther:
What does your web.xml file look like now?
class MyDean extends HttpServlet {
public class MyDean extends HttpServlet {