*
The moose likes Servlets and the fly likes A page not found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "A page not found error" Watch "A page not found error" New topic
Author

A page not found error

Andria Davis
Greenhorn

Joined: Nov 22, 2005
Posts: 4
Hi
I have aproblem,I have an HTML form its action is on a servlet and it inserts data in a database, When i run the HTML form it gives me the page not found error.
I checked on the servlets' path and on the JDBC statements and they are correct but it still gives me the same error.
So can anyone help me to solve it.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

if the URL were correct, you wouldn't be getting an error.

Please show us the servlet and servlet mapping declarations from the web.xml, as well as the form action from the HTML file. We also need to know what context path the app is deployed to.

The JDBC information is irrelevant.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Andria Davis
Greenhorn

Joined: Nov 22, 2005
Posts: 4
Hi
***This is the servlet


***And this is the servlet mapping declarations from the web.xml file
- <servlet-mapping>
<servlet-name>Form1</servlet-name>
<url-pattern>/Form1</url-pattern>
</servlet-mapping>

***And the form action from the HTML page is
<form name="form1" method="post" action="/Adler/Shopping.Form1">

***I wanna add a note here I'm using the IBM WebSphere Application Developer
V 5.1 is it relevant.

Thanks
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

The URL pattern does not match your form action.
Wouldn't that be the problem ?


[My Blog]
All roads lead to JavaRanch
Manoj Kumkumath
Ranch Hand

Joined: Dec 01, 2005
Posts: 71
Andria,
Can you check if you have the servlet class name specified in web.xml as shown below?


-Manoj
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Make sure you have the following defined. Also, the URL ppattern needs to map your form's action.

<servlet>
<servlet-name>Form1</servlet-name>
<servlet-class>adler.Form1</servlet-class>
</servlet>
[ January 17, 2006: Message edited by: Bosun Bello ]

Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A page not found error