I call a servlet as the action in a form, from a jsp.

Alex Chaffee

You'll have to pass the JSP's URI in to the servlet, and have the servlet call sendRedirect to go back to the JSP. For example:


<FORM ACTION="/foo/myservlet">
<INPUT TYPE="HIDDEN" NAME="redirect" 
   VALUE="/foo/thisjsp.jsp">
Shoe size: <INPUT NAME="shoesize">
<INPUT TYPE="SUBMIT">
</FORM>
Then in the servlet...
response.sendRedirect(request.getParameter("redirect"));
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact