• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The requested resource () is not available.

 
Dominic Lee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 637
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sanjeev Kumaar
Greenhorn
Posts: 12
Java MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.





 
Dominic Lee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
Java MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 637
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, re-check your servlet code and package structure.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic