Java Reference
In-Depth Information
Is the procedure for creating a custom tag starting to seem familiar? As a quick reminder, the steps are:
A.
Create a tag support class
B.
Add the XML to the tag library
C.
Insert the tag library directive and tag into a JSP
Steps 1 through 6 did A. Step 7 and 8 will do B and, after creating two JSPs, steps 20 through 24 will do C.
7.
In TNT.tld, add the following XML to define the new delEmp tag and associate the tag with
the Java tag handler class DeleteEmp:
<tag>
<name>delEmp</name>
<tagclass>c11.DeleteEmp</tagclass>
</tag>
8.
Save TNT.tld.
9.
In WebContent/c11, create two new JSPs called ConfirmEmpDel and EmpDel.
10.
In ConfirmEmpDel, insert a Form from the Form Tags tray and then insert following
centered text (the font is Verdana) into the form:
Please confirm that employee
should be permanently deleted from the database
by clicking the Confirm button
11.
In the JSP Tags drawer, click on Get Property and then click on the blank line (after the first
line of text).
12.
At the Insert JSP Get Property window specify the Bean type as session, EmpBean as the
Bean name, empName as the Property name and click the OK button.
13.
In Page Designer, select the Get Property tag by clicking at the end of the first line of text
and then dragging the cursor to the second line of text.
This will select the tag and the line breaks (as in Figure 11-15 ).
Search WWH ::




Custom Search