This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in running servlet programs  RSS feed

 
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
Posts: 66142
141
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
Boost this thread!