• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Requested resource not available error

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ??
 
Chithra Samy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi balasubramani,

Thnx a lot for ur reply.. My problem got solved..
 
reply
    Bookmark Topic Watch Topic
  • New Topic