Java Reference
In-Depth Information
Fig. 10.6
Output from
JDBCX.jsp
1. If the parameter has the same name as the property, simply omit the
value
attribute of that property. For example:
<jsp:setProperty name="account" property="balance" />
(Note that there is no need to call
getParameter
to retrieve the value of the
parameter.)
2. Use a parameter with a different name, replacing the
value
attribute with a
param
attribute. For example:
<jsp:setProperty name="account" property="balance"
param="userEntry" />
3. Set
al l
bean properties that have names matching those of parameters sent to the
page (at the same time). In this variation, only attributes
name
and
property
can be used, with the latter being set to
“*”
. For example:
<jsp:setProperty name="account" property="*" />
(Parameters having names matching attributes of
account
are used to set
values of those attributes.)
Now let's take a look at a complete JSP that makes use of a
<jsp:setProperty>
tag…
Search WWH ::
Custom Search