Java Reference
In-Depth Information
Figure 9-5.
Tutorial: Creating a Servlet for
It's now time to create the complementary servlet.
1.
Create a new servlet in TutorialsWeb/Java Resources/src called EmpServlet.
2.
In EmpServlet's source code, change the request and response variable names to
req and resp.
3.
In the doPost method, add the following statements:
String function = req.getParameter("functionLB");
System.out.println(function);
String exmp = req.getParameter("exmpDDM");
System.out.println(exmp);
The println statements will simply test that the servlet is retrieving the values from the new Web page
components. After we have verified that the values are being retrieved, we will remove the println statements.
4.
Return to the EnterEmpInfoForm and, if needed, change back to the Design view.
5.
Display the form's properties.
 
Search WWH ::




Custom Search