Reputation: 2453
JSP CODE:
Upload File:
<input name="file" type="file" id="file"><br><br>
<input type="submit" name="Submit" value="Submit"/><br><br>
<input type="reset" name="Reset" value="Reset"/>
</form>
I have the above JSP file which will be executed with the help of Tomcat server and this is stored in the following location of my system.
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\CheckURL
I have written a servlet program for catching the request and sending the reponse from the given JSP file.
My query here is, in which path the servlet program must be stored in my system.
And please let me know whether a servlet program can be compiled using javac NewServlet.java or it can be executed directly during runtime. Because on compiling that servelet program I get a lot of errors.
Am a beginner in java. If u can give me a detailed outlook on the above issue, it would be of great use. Thanks in advance.
Upvotes: 0
Views: 1334
Reputation: 597016
The servlet tutorial is a good place to start.
A few points to answer your particular questions:
javac NewServlet.java
but you have to specify classpath (-cp
) that contains the servlet-api.jar
.class
file in webapps\checkURL\WEB-INF\classes
WEB-INF\web.xml
using <servlet>
and <servlet-mapping>
. (there is a easier way with Tomcat 7 and Servlets 3, but you are on 5.5)Upvotes: 3