This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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: 64629
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