Request dispatcher:Forward
hi,
I am taking data from user in a jsp page "customer.jsp" and on submitting form in this jsp page it passes the data to a servlet. Servlet then forwards the response to the same jsp page "customer.jsp" with the same values if there is any duplicate id in the database by giving the message userid already exist.
Now the problem occurs when forwarding the response to the jsp page,we r not getting the background properties of the page but we r getting therespnse from servlet and when we submit the same page we r getting the error as
The requested resource (/projectname/servlet/servlet/Customer) is not available
I mean im not getting background image.
when we submit the jsp page to the servlet(addsubcontractor.java) like
http://localhost:8080/Newproject/addsubcontract.jsp
and in the servlet i am inserting the data into the database and then i am forwarding respose to the same jsp page(addsubcontractor.jsp)
we r getting the details in the following url without background image
http://localhost:8080/Newproject/servlet/addsubcontract
and the i am submitting the form by making some changes we r getting the following error.
description The requested resource (/Newproject/servlet/servlet/addsubcontract) is not available.
How can u call servlet from jsp ?
That "servet " as u r naming it must be a bean which contains only setter getter methods for jsp page ..
Explain u r problem in brief