Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A page not found error

 
Andria Davis
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Andria Davis
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URL pattern does not match your form action.
Wouldn't that be the problem ?
 
Manoj Kumkumath
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andria,
Can you check if you have the servlet class name specified in web.xml as shown below?


-Manoj
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic