aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Error 404 while requesting for a page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Error 404 while requesting for a page" Watch "Error 404 while requesting for a page" New topic
Author

Error 404 while requesting for a page

Manju Devarla
Ranch Hand

Joined: Dec 14, 2006
Posts: 85
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..(Evn checked log file nothing is mentioned)

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

http://localhost:8080/ch1/Serv1

Can anyone help me out in solving this..
Elan Ram
Ranch Hand

Joined: Dec 14, 2006
Posts: 40
Hi,

correct the WEB_INF directory name to WEB-INF, and try again.


Thanks and regards,
Elan
Manju Devarla
Ranch Hand

Joined: Dec 14, 2006
Posts: 85
sorry ie my typing mistake..its WEB-INF directory only
Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
please post the code fpr web.xml
and also the directory structure of your webapp


SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
S Kapoor
Greenhorn

Joined: Mar 31, 2006
Posts: 20
Have you implemented the doGet in the servlet?


SCJP, SCJWS, SCWCD
Manju Devarla
Ranch Hand

Joined: Dec 14, 2006
Posts: 85
Hi Niranjan,

This is my web.xml code :
<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-mappling>
<servlet-name>Chapter1 Servlet</servlet-name>
<url-pattern>/Serv1</url-pattern>
</servlet-mappling>
</web-app>

yes implemeted doGet() method and have class file in the directory given below :

C:\Program Files\apache-tomcat-5.5.20\webapps\ch1\WEB-INF\web.xml
C:\Program Files\apache-tomcat-5.5.20\webapps\ch1\WEB-INF\classes\Ch1Servlet.class

and accessing thorugh URL - http://localhost:8080/ch1/Serv1 : displaying error message request/resource not avialable
S Kapoor
Greenhorn

Joined: Mar 31, 2006
Posts: 20
Not sure if you cut/paste the web.xml, but if you have, the element name should be <servlet-mapping> not <servlet-mappling>
Manju Devarla
Ranch Hand

Joined: Dec 14, 2006
Posts: 85
Thank you verymuch kapoor ie the error..i chnaged to mapping and its working fine..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error 404 while requesting for a page