The HelloWorld class (Servlet) will be under directory
According to the discreptor you have written.
and the directory in which you are putting the web-application is not clear to me. If you are doing it in the root then no problem. But if you are doing it in some directory under root then give the extension of the directory as .war eg. testing.war would be the directory name.
I have worked on web-logic and jboss. Both follows the same rule.
The Directory structure will be
testing.war |___WEB-INF | |_____classes(Directory)(Servlets will be kept here) | |_____ web.xml (Deployment Discreptor) | | |___JSP Files
It doesn't matter where your .java files are. You need create the war file from a directory which is having the following structure test |_WEB-INF | |_web.xml (Deployment Discriptor) | |__classes(Directory) | |__com | |___jspbook | |____HelloWorld.class | |_All your JSP Files [ March 28, 2005: Message edited by: Vijay Kiran ]
Vijay<br />I blog, therefore I am<br /><a href="http://www.vijaykiran.com" target="_blank" rel="nofollow">www.VijayKiran.com</a>
I haven't got up to a point which tells me to create a .war file yet. This is a hello world servlet. ie. It should be very simple, I have followed the instructions accurately as far as I can tell by moving the source code to the directory (in full) as follows:
The book then doesn't actually say to run ant from the WEB-INF directory but I thought that it must need that as it needs to compile the source code, I did that and it produces HelloWorld.class as expected in the same directory.
at this point tomcat has been stopped and restarted as part of the ant operation however I still get the 404 error. When hitting the URL previously mentioned and the tomcat logs indicate that the class file isn't found. I'm obviously missing something pretty major...