GeeCON Prague 2014*
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


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.

Dominic Lee
Greenhorn

Joined: May 21, 2011
Posts: 4
hey guys, I know this crops up time and time again but I think on this occasion its different for me.

Basically, where my tomcat has been installed I have a webapps\Beer-v1\WEB-INF\web.xml and a webapps\Beer-v1\form.html

So after starting the tomcat server and type the url: http://localhost:8080/index.html I get the apache homepage which proves the server is up and running

but when I try starting my form.html using the url http://localhost:8080/Beer-v1/form.html I get the error as in the subject: Error 404 The requested resource () is not available.

The web.xml looks like this:



............and the form.html looks like this:

[code=java]
<html><body>
<h1 align="center">Beer Selection Page</h1>
<form method="POST"
action="SelectBeer.do">
Select beer characteristics<p>
Color:
<select name="color" size="1">
<option>light
<option>amber
<option>brown
<option>dark
</select>
<br><br>
<center>
<input type="SUBMIT">
</center>
</form></body></html>
[code]
Rahul Sudip Bose
Ranch Hand

Joined: Jan 21, 2011
Posts: 637

Dominic Lee wrote:



One mistake


Something like this had happened to me before. Be careful when you are making the web.xml file. Small mistakes can lead to this error.
I am getting a similar error here : bugged
Try it when you get to that chapter.

good luck


SCJP 6. Learning more now.
Sanjeev Kumaar
Greenhorn

Joined: Jun 10, 2010
Posts: 12


Hi Dominic !


Try this http://localhost:8080/Beer-v1/

Is it giving any list containing name of html files ?

If your answer is yes then
you must have misspelled your file name or something like that
else
you must have not provided the classes folder inside WEB-INF which will contain your servlet according to your web.xml.






SCJP 5, SCWCD
Dominic Lee
Greenhorn

Joined: May 21, 2011
Posts: 4
hi Rahul,
Bit confused are you syaing I can remove that line with the SelectBeer.do? Could you please copy in the full correct version of the web.xml code you mean without all the web-app weird stuff

Sanjeev I have tried using just localhost:8080/Beer-v1/ but I still get the same error i.e. there are no files to view

Can't believe something so basic is beginning to take over my life
Sanjeev Kumaar
Greenhorn

Joined: Jun 10, 2010
Posts: 12


for a time ,

you just remove/comment the entire <servlet> tag and <servlet-mapping> tag in your web.xml & then try to run & say what you get .

& don't forget to restart server after any changes you are making in web.xml.
Dominic Lee
Greenhorn

Joined: May 21, 2011
Posts: 4
Is this what you mean so I have removed anything servlet related but kept the form.html the same?

Eeven after the starting the server again I still get the same error


Rahul Sudip Bose
Ranch Hand

Joined: Jan 21, 2011
Posts: 637

Also, re-check your servlet code and package structure.

 
GeeCON Prague 2014
 
subject: The requested resource () is not available.