This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help please

 
jothi kiruthika
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please sum1 temme watzz wrong in my procedure.my servlet compiles fine n i've put the class file in C:\apache-tomcat-5.5.26\webapps\ROOT\WEB-INF\classes and when i type the foll in my browser address bar http://localhost:8080/servlet/HelloServlet i get a 404 error.. help me to fix it
 
Chandan Ghosh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you do the servlet configuration in web.xml file? Please check the below..
Put the servlet entry in web.xml and user servlet mapping for your servlet as "/servlet/HelloServlet"

<servlet>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>foo.HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<uri-pattern>/servlet/HelloServlet</uri-pattern>
</servlet-mapping>
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jothi, welcome to the Ranch.

Please take the time to read our page on HowToAskQuestionsOnJavaRanch

In particular,

http://faq.javaranch.com/java/UseRealWords - Use Real Words
http://faq.javaranch.com/java/UseAMeaningfulSubjectLine - Use a meaningful subject line.

If you ask questions correctly then I can spend my time answering your question rather than asking you to ask questions correctly.

Enjoy your stay!
Dave
 
Soniya Ahuja
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, if you've put your servlet class directly under ROOT/WEB-INF/classes, make sure that you have modified web.xml and put in the correct servlet entry. Also, I don't think you need to append servlet after localhost:8080 unless you have mapped it that way.

Please also detail your problem a little so that we could help easily.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic