Sun Java System Portal Server Mobile Access 7.1 Tag Library Reference

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 for which the Required value is “No”:

id

Specifies the id of the bean to create.

name

Specifies the name of the bean to use.

Properties

This tag provides the following bean properties for which the Type values are “Integer”, “Boolean” and Access value is “Get/Set”:

truncation

The number of characters to which to truncate the body.

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 "&".

from

If present, specifies that all instances of the indicated value be replaced by the value specified by the to attribute.

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.

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"/>