edit
|
Description |
This tag denotes a reference to an "edit" bean,
a bean whose properties specify that certain editing be performed upon the
enclosed body. The edit will be performed in the following order:
- String substitution, if any specified.
- String truncation, if any specified.
- Character entity escaping, if any specified.
The edit bean may also be referenced by the get/set
tags, resulting in the appropriate modifications to the values being get
or set.
|
Tag Body |
JSP |
Restrictions |
At least the id or name attribute must be specified, but
not both. |
Attributes |
This tag has the following attributes:
Attribute |
Description |
Req'd? |
id |
Specifies the id of the bean to create. |
No |
name |
Specifies the name of the bean to use. |
No |
|
Properties |
This tag provides the following bean properties:
Property |
Description |
Type
|
Access |
truncation |
The number of characters to which to truncate the body. |
Integer
|
Get/Set |
escape |
A boolean that indicates whether or not to apply XML style character
entity escaping to the body. The characters that will be escaped are: "<",
">", and "&". |
Boolean
|
Get/Set |
from |
If present, specifies that all instances of the indicated value be
replaced by the value specified by the to attribute. |
String
|
Get/Set |
to |
Specifies the string with which to replace all occurrences of the string
specified by the from attribute. If to is not specified, it
defaults to the null string. |
String
|
Get/Set |
|
Example(s) |
<%-- truncate a mail subject line --%>
<util:edit id="t1">
<util:set property="truncation" value="20"/>
<util:set property="escape" value="true"/>
</util:edit>
...
<util:edit name="t1">
<mail:message>
<mail:get property="subject"/>
</mail:message>
</util:edit>
...
<%-- same thing, different way --%>
...
<mail:get property="subject" edit="t1"/>
|