aspose file tools*
The moose likes Tomcat and the fly likes HTTP Status 404 - /Beer-v1/form.html Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "HTTP Status 404 - /Beer-v1/form.html" Watch "HTTP Status 404 - /Beer-v1/form.html" New topic
Author

HTTP Status 404 - /Beer-v1/form.html

Tom Nishan
Greenhorn

Joined: Feb 04, 2011
Posts: 7
HTTP Status 404 - /Beer-v1/form.html

Hello everyone,

I have a problem when I trying to open form.html file.
I installed Tomcat 5.5 and when I run tomcat I can see welcome page.

Tomcat5/webapps/Beer-v1/WEB_INF/web.xml file:

<?xml version="1.0" encoding="ISO-8859-1"
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">

<servlet>
<servlet-name>Ch3 Beer</servlet-name>
<servlet-class>com.example.web.BeerSelect</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Ch3 Beer</servlet-name>
<url-pattern>/SelectBear.do</url-pattern>
</servlet-mapping>

</web-app>

Tomcat5/webapps/Beer-v1/form.html:

<html><body>
<h1 align="center">Beer Selection Pages</h1>
<form method="POST"
action="SelectionBeer.do"
Select beer characteristics<p>
Color:
<select name="color" size="1">
<option value="light"> light </option>
<option value="amber"> amber </option>
<option value="brown"> brown </option>
<option value="dark"> dark </option>
</select>
<br><br>
<center>
<input type="SUBMIT">
</center>
</form></body></html>

Please help. Thank you in advance.
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
What URL are you using to access form.html? And what error are you getting?
Tom Nishan
Greenhorn

Joined: Feb 04, 2011
Posts: 7
Thank you for your quick response.
I'm using the following URL:

http://localhost:8080/Beer-v1/form.html

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

Is the context even running? Use the Tomcat Manager app to find ut.

See the Tomcat FAQ if you don't already have the Manager app configured.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ankittt agarwala
Ranch Hand

Joined: Jan 19, 2011
Posts: 42
i think there is a little error in html coding part
you didnot use '>' in form line
<form...............
..................where is '>'
but besides that there is some more error which is not making you open this page
do one thing if you are able to see the welcome page on entering http://localhost:8080/ then your tomcat is configured rightly
use the latest version of tomcat as it has removed many bugs of previous versions
Tom Nishan
Greenhorn

Joined: Feb 04, 2011
Posts: 7
Thank you guys!

I installed Tomcat 7 and I got welcome page.
I still got the same error.

HTTP Status 404 - /Beer-v1/form.html

type Status report

message /Beer-v1/form.html

description The requested resource (/Beer-v1/form.html) is not available.

Apache Tomcat/7.0.5
ankittt agarwala
Ranch Hand

Joined: Jan 19, 2011
Posts: 42
i think your form.html is not a html file actually its a notepad file with name form.html
do you get a webpage on opening it directly by double clicking it??
if yes then do the following thing
write the following code in a notepad file and click save as
there name it as form.html and in type press "all files" and then save it
in tomcat webapps directory make a new folder t and paste the above form.html file in t
now start tomcat and open the link http://localhost:8080/t/form.html
now it should open.
code

<html>
<h1 align ="center">this is a page</h1>
<form method="post"
action ="selecttea.do">
select tea characteristics<p>
color:
<select name ="color" size="1">
<option value="light"> light </option>
<option value="amberr"> amberr </option>
<option value="orange"> orange </option>
<option value="green"> green </option>
</select>
<br><br>
<center>
<input type="submit">
</center>
</form>
</body>
</html>
dont define any xml file thats dd or anything else this is just to check your form.html
remember the form.html should appear to you as only form(without the html extension) in the t directory after saving
Tom Nishan
Greenhorn

Joined: Feb 04, 2011
Posts: 7
You were right, Ankittt. I got the result as shown in the book. Thank you Ankittt. I really appreciate it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Status 404 - /Beer-v1/form.html