Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

404 error

 
shubhangi phadke
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am getting request resource not avialbe when i access the servlet class which is alredy present in correct path as page30-31 in HeadFirst jsp&servlets..

Created the correct directory structure under webapps/ch1 : WEB-INF and classes put web.xml and class file correctly..

able to access servlet-examples ans jsp-examples but not the below one

http://localhost:8080/ch1/Serv1


My web.xml is


<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2.4.xsd"
version="2.4">

<servlet>
<servlet-name>Chapter1 Servlet</servlet-name>
<servlet-class>Ch1Servlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Chapter1 Servlet</servlet-name>
<url-pattern>/Serv1</url-pattern>
</servlet-mapping>
</web-app>



Can anyone help me out in solving this..
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should put your servlets in packages, to avoid unpredictable results.
 
S Kapoor
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Confirm that this is the name and location of the servlet class:
webapps\ch1\WEB-INF\classes\Ch1Servlet.class
 
shubhangi phadke
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey thanks ,i got the result
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic