aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Requested resource not available error 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 "Requested resource not available error" Watch "Requested resource not available error" New topic
Author

Requested resource not available error

Chithra Samy
Greenhorn

Joined: Jun 13, 2006
Posts: 2
Hi,
I am very new to servlet concept..I installed tomcat 5.0 and i have jdk 1.5..

I have set all the variables CLASSPATH,JAVA_HOME,CATALINA_HOME...
and i compiled the HelloWorldServlet program in deshmukh book and got the class file also..

I kept the class file in the following path Tomcat 5.0\webapps\Test\WEB-INF\classes\HelloWorldServlet.class

I have kept the web.xml in the following path Tomcat 5.0\webapps\Test\WEB-INF

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>HelloWorldServlet</servlet-name>
<servlet-class>HelloWorldServlet</servlet-class>
</servlet>
</web-app>


And when i try the following through the browser http://127.0.0.1:8080/Test/servlet/HelloWorldServlet
I am getting request resource not available error..

But i was able to execute the servlet examples already present through the browser http://127.0.0.1:8080/servlet-examples/servlet/HelloWorldExample

Can anyone guide me in this.

Thnx in advance.
Balasubramani Dharmalingam
Ranch Hand

Joined: Dec 06, 2004
Posts: 116
you should mention the url-pattern for your servlet.modify your web.xml as,

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>HelloWorldServlet</servlet-name>
<servlet-class>HelloWorldServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>HelloWorldServlet</servlet-name>
<url-pattern>/Hello</url-pattern>
</servlet-mapping>
</web-app>

Now try,
http://127.0.0.1:8080/Test/Hello


Balasubramani SD,<br />SCJP 1.4,SCWCD 1.4,SCJP 5.0<br /><a href="http://sd.balasubramani.googlepages.com" target="_blank" rel="nofollow">www.sd.balasubramani.googlepages.com</a>
Sathish Nagappan
Ranch Hand

Joined: Nov 05, 2005
Posts: 76
Balasubramani , I am just curious about the career scope of SCWCD and SCJP ?? Where are you working rite now,If you dont mind to answer ??


SCJP, SCWCD, SCBCD, IBM XML, IBM OOAD, SCEA 5, ITAC - Distinguished IT Architect.
Chithra Samy
Greenhorn

Joined: Jun 13, 2006
Posts: 2
hi balasubramani,

Thnx a lot for ur reply.. My problem got solved..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Requested resource not available error