-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Jakarta EE Application Development
By :

In many cases, one servlet processes form data, then transfers control to another servlet or JSP to do some more processing or displays a confirmation message on the screen. There are two ways of doing this: either the request can be forwarded or the response can be redirected to another servlet or page.
Notice how the text displayed in the previous section’s example matches the value of the value attribute of the checkboxes that were clicked, and not the labels displayed on the previous page. This might confuse the users. Let’s modify the servlet to change these values so that they match the labels, then forward the request to another servlet that will display the confirmation message in the browser.
The doPost()
method for the new version of MultipleValueFieldHandlerServlet
is shown next:
protected void doPost(HttpServletRequest request, HttpServletResponse response) { String[] selectedOptions...