aspose file tools*
The moose likes Servlets and the fly likes  The requested resource is not available. 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 " The requested resource is not available." Watch " The requested resource is not available." New topic
Author

The requested resource is not available.

Alpesh Gediya
Greenhorn

Joined: Nov 23, 2009
Posts: 24
hello Friends,

I am facing The requested resource is not available error.

My webapps structure is as below.

Test-
|
|web.xml
|-META-INF
|-WEB-INF
|
|-classes
-DemoServlet.java/class
-log4j.xml

|-lib
-log4j.jar


web.xml content are as below.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004 The Apache Software Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!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>Demo</servlet-name>
<servlet-class> DemoServlet </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Demo</servlet-name>
<url-pattern>/servlet/Demo</url-pattern>
</servlet-mapping>

</web-app>


.. can any help me on this..

whenever i hit http://localhost:8080/Test/servlet/Demo.. it give me The requested resource not available.

Application deployed on tomcat smoothly.. but i am not able to access Demoservlet.

any help is appreciated.


Alpesh Gediya
Do not re-invent the wheel.
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 606

Your web.xml should be inside WEB-INF folder.

Also just place a simple jsp file helloWorld.jsp inside test and see if you are able to access it using,

http://localhost:8080/Test/helloWorld.jsp

Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
Charles 'King
Ranch Hand

Joined: Jul 05, 2009
Posts: 56

1. Please verify your servlet is in this directory structure:



2. Why aren't you using conventional packaging of your classes? e.g. com.sun.servlets.DemoServlet

 
 
subject: The requested resource is not available.