Build.xml and servlet?


#1

Hello Friends,

Is build.xml really necessary and can someone pliz explain to me what the code is all about.
I have asked where should i place MyServlet.java?My web.xml is in webapps/sample/WEB_INF/ and MyServlet.class is in webapps/sample/WEB_INF/ classes.Where should i place MyServlet .java?
Im asking this because im getting this error message:

HTTP status 404: “The requested resource (/tomcat/webapps/sample/WEB-INF/classes/servlets/MyServlet) is not available”.

NB: MyServlet.java is in webapps/sample/WEB-INF/classes/servlets at the moment.

Cheers!


#2

I don’t quite understand the context of your question, but a build.xml file is for use with the Apache Ant tool (kind of like a more useful version of Make). Check out http://ant.apache.org/ for more info.

Presumably the ant build script compiles your web service (your current problem appears to be that Tomcat [I assume this is what you’re using as the servlet container] expects a compiled class file/jar and you’re giving it an uncompiled .java file). So yeah, try compiling your source files first.

–flux