Java Reference
In-Depth Information
7.
Select all the components on the page (i.e., the table and submit button).
8.
Click the Insert Form button.
The table and submit button will be enclosed in a dashed line box. The box indicates the form. In the Properties
view, the form tab is selected and its attributes/properties are displayed.
9.
In the Attribute pane, click the Action Browse button and select servlet from the shortcut
menu (see Figure 8-27 ).
10.
At the Select Servlet window, select MyServlet and click the OK button.
The Properties view will display /TutorialsWeb/MyServlet in the Action field.
11.
In the Properties view, click the Post method checkbox to ensure that a Post request is
generated when the submit button is clicked.
12.
Save the source code.
The Web page is now tied to the servlet. Let's prove it. We'll put some code in the doPost method, run the page on
the server and submit the form. If the doPost code is executed, then everything is good.
13.
In MyServlet, copy all the statements from the doGet method into the doPost method.
In doPost, change the title to “ MyServlet Post Response ” and the page content to
Howdy from MyServlet's doPost method!
14.
15.
Run the EnterEmpInfoForm Web page on the server.
16.
In the browser window, click the submit button.
The RAD browser should look like Figure 8-28 .
Search WWH ::




Custom Search