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 please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "help please" Watch "help please" New topic
Author

help please

jothi kiruthika
Greenhorn

Joined: Aug 25, 2008
Posts: 1
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

Joined: Jun 13, 2005
Posts: 21
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>


Thanks & Regards,<br />Chandan Ghosh<br />SCJP1.4
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

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

Joined: Jul 20, 2008
Posts: 83
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.


SCJP 1.5 | SCWCD 5 | SCJP 6.0
[url]http://a2zjava.webs.com[/url] - Online training for Java/JSPs and Servlets/SCJP/SCWCD
http://soniyaahuja.webs.com
 
Don't get me started about those stupid light bulbs.
 
subject: help please
 
Similar Threads
Servlets not loading
unable to compile
What is the problem?
how to use the servlet in tomcat??
Testing First Servlet....please help