• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The requested resource is not available.

 
Lee Chi Ho
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!
Please, SeachFirst
 
lakshmana dhanimireddi
Greenhorn
Posts: 18
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65128
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Lee Chi Ho
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65128
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We need to know how the servlet is mapped to a URL in the deployment descriptor (web.xml).
 
Lee Chi Ho
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65128
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic