| Author |
The requested resource is not available.
|
Lee Chi Ho
Greenhorn
Joined: Aug 17, 2011
Posts: 3
|
|
I have installed Eclipse and Tomcat as a server.
However the following error cannot be resolved.
I am wondering what the error is on my servlet.
Thanks for your kindly help~~~
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
Welcome to JavaRanch!
Please, SeachFirst
|
 |
lakshmana dhanimireddi
Greenhorn
Joined: Jul 05, 2011
Posts: 14
|
|
|
may be your deployment descriptor web.xml is wrong or not available in your directory structure. (for servlets in tomcat)(i don't know about elipse).
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56191
|
|
Without more details it's impossible to say. Most likely your URL does not match the mapping in the deployment descriptor, or perhaps you haven't mapped the servlet at all.
The use of the term "servlet" in the URL make me suspect the latter.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Lee Chi Ho
Greenhorn
Joined: Aug 17, 2011
Posts: 3
|
|
Thanks for all your replies, and I am very delighted due to your kindly help
Actually, I am a newer of Java servlet and created a simple servlet called hello.
The following is the code
I have do all procedures (installing server according to the instruction proposed both on internet and my lab notes) lots of times. However the error still occurs. Indeed, I don't know how to match the mapping and I think the eclipse can do it internally.
Therefore what should I do next step?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56191
|
|
|
We need to know how the servlet is mapped to a URL in the deployment descriptor (web.xml).
|
 |
Lee Chi Ho
Greenhorn
Joined: Aug 17, 2011
Posts: 3
|
|
There is one at my server and I have not created web file.
And the followings are some parts in the file (Other servlets and mappings are uncommented)
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
- <init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
- <init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
- <init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
- <init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
- <!-- The mappings for the JSP servlet
-->
- <servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56191
|
|
If your web app has no web.xml, you cannot call any servlets.
I think at this point you need to find a good tutorial on how to set up a web application.
|
 |
 |
|
|
subject: The requested resource is not available.
|
|
|