Servlet Forwarding Question
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mark_Gowdy
Posted On:   Monday, May 13, 2002 02:01 AM

Hi I am sure that this can easily be answered by some of the experts out there, so I hope you can help. I am playing around with Servlets, JDBC, MySql etc and I have created an HTML to allow me to enter data onto a MySql table. Now the first time I submit the form, the servlet is invoked and the data is stored. What I am then doing is calling getRequestDispatcher() with the page I want called - the same data entry page I was previously at, and then calling requestDispatcher.forward(request,response). When I get back to the original HTML page the URL has the servlet address (I expected this) - http://localhost:8080/test/servlet/TestServlet. Now when I try to submit data I get a 404 error stating that the   More>>

Hi


I am sure that this can easily be answered by some of the experts out there, so I hope you can help.


I am playing around with Servlets, JDBC, MySql etc and I have created an HTML to allow me to enter data onto a MySql table. Now the first time I submit the form, the servlet is invoked and the data is stored. What I am then doing is calling getRequestDispatcher() with the page I want called - the same data entry page I was previously at, and then calling requestDispatcher.forward(request,response).


When I get back to the original HTML page the URL has the servlet address (I expected this) - http://localhost:8080/test/servlet/TestServlet. Now when I try to submit data I get a 404 error stating that the requested resource (/test/servlet/servlet/TestServlet) is not available. The form action is "servlet/TestServlet" so I sort of know where the problem is, but not why and how to fix the problem.


Any help would be gratefully appreciated.


Mark

   <<Less

Re: Servlet Forwarding Question

Posted By:   Anonymous  
Posted On:   Monday, May 13, 2002 02:04 PM

Try to use "/servlet/TestServlet" as the action of the form.


Regards

About | Sitemap | Contact