This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help, where to put servelet, html, jsp file

 
Hellen Han
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1467
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, maha:
Thanks for your response, now I know where to put those files, and thanks you.
Best regards
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic