File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in running servlet programs

 
nishadinesh gupta
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i had problem in running my servlet programs. after starting the javawebserver and compiled the myservlet.java file and saved it to javawebserver2.0/servlets, i typed in browser
http://localhost:8080/servlet/myservelt
but it was giving me "Not Found (404) error"

The same program is running on my friends PC.

Please suggest me some remedie to this its quite urgent.

Thanks
 
Eduardo Dela Rosa
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Make sure that your servlet has mapping in your deployment descriptor (web.xml) as in:

<servlet>
<servlet-name>My Servlet</servlet-name>
<servlet-class>xxx.servlets.MyServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>My Servlet</servlet-name>
<url-pattern>/servlet/myServlet</url-pattern>
</servlet-mapping>

With this mapping, you can invoke your servlet as:

http://localhost:8080/servlet/myServlet

HTH.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javawebserver2.0?

Why are you using something so antiquated?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic