File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes help, where to put servelet, html, jsp file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "help, where to put servelet, html, jsp file" Watch "help, where to put servelet, html, jsp file" New topic
Author

help, where to put servelet, html, jsp file

Hellen Han
Greenhorn

Joined: Oct 10, 2000
Posts: 17
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.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Hellen,
Do one thing. Ar present use the 'examples' web application dir structure in ...web-apps dir. Now store any .hrml file under

Try it ! It should work. Make HelloWorld.class as a servlet class file. PLease come back if you have some difficulty.
regds
maha anna
Hellen Han
Greenhorn

Joined: Oct 10, 2000
Posts: 17
Hi, maha:
Thanks for your response, now I know where to put those files, and thanks you.
Best regards
 
Don't get me started about those stupid light bulbs.
 
subject: help, where to put servelet, html, jsp file
 
Similar Threads
Problem in running JSPs on Tomcat
HFS: Problem with deploying and testing Beer-v1 App
Help -unable to run servlet in APACHE
Tomcat WebApp Deployment
page not found error