aspose file tools*
The moose likes Servlets and the fly likes problem in running servlet programs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem in running servlet programs" Watch "problem in running servlet programs" New topic
Author

problem in running servlet programs

nishadinesh gupta
Greenhorn

Joined: Apr 05, 2006
Posts: 4
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

Joined: Apr 15, 2004
Posts: 25
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.


Eduardo dela Rosa<br />SCJP 1.4
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

javawebserver2.0?

Why are you using something so antiquated?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in running servlet programs