Hi,
I am new to Servlet and try to get some execise done.
I have downloaded the Tomcat, figure out the classpath. I look Ok.
I read some previous discussion about where to put servlet and html and jsp.
It was said to put html, jsp under c:\tomcat\web-apps\examples and servelet to c:\tomcat\web-apps\examples\web-inf\classes under the root directory where html, jsp were.
SO I Have tried, the examples from book: Java servelet programming, HelloWorld.java: If I put this file under c:\tomcat\bin it worked fine, but if I put this under c:\tomcat\web-apps\examples\web-inf\classes and it will not work.
Given Information:
Error: 404
Location: /servlet/HelloWorld
Same strang thing happened to second example, which come with one form.html and related servelet Hello.java. If I Put form.html under c:\tomcat\web-apps\examples and Hello.java under c:\tomcat\bin it worked, but if I moved Hello to c:\tomcat\web-apps\examples\web-inf\classes it will not work.
I have read some material about this, but I still confused and do not know how to put html, jsp, servlet file.
Please help
Thank in advance.
I am new to Servlet and try to get some execise done.
I have downloaded the Tomcat, figure out the classpath. I look Ok.
I read some previous discussion about where to put servlet and html and jsp.
It was said to put html, jsp under c:\tomcat\web-apps\examples and servelet to c:\tomcat\web-apps\examples\web-inf\classes under the root directory where html, jsp were.
SO I Have tried, the examples from book: Java servelet programming, HelloWorld.java: If I put this file under c:\tomcat\bin it worked fine, but if I put this under c:\tomcat\web-apps\examples\web-inf\classes and it will not work.
Given Information:
Error: 404
Location: /servlet/HelloWorld
Same strang thing happened to second example, which come with one form.html and related servelet Hello.java. If I Put form.html under c:\tomcat\web-apps\examples and Hello.java under c:\tomcat\bin it worked, but if I moved Hello to c:\tomcat\web-apps\examples\web-inf\classes it will not work.
I have read some material about this, but I still confused and do not know how to put html, jsp, servlet file.
Please help
Thank in advance.