This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in running servlet programs

 
nishadinesh gupta
Greenhorn
Posts: 4
  • 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
  • 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: 64683
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javawebserver2.0?

Why are you using something so antiquated?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic