Config Tag Handler

Tag Handler is used to convert JSP tag to HTML code and used by visual part.

Currently, following handler types are support:

Output tag data

Create a text block, the text is composed by Tag value. the Text source could be:

  • Output element name and prefix
  • Output attribute value
  • Output attribute name and value
  • Output extra text

Output tag data (skip child element)

Like previous one, but it will not process child elements.


Output child

This is default handler, child nodes will be processed and skip this tag.

Ignore

Do not process self and all child nodes.

Output primitive HTML element

Output a HTML element, the Text source could be:

  • Copy attribute: copy tag's attribute to output element.
  • Copy attribute, value is a resource bundle key: like previous one, but get text from resource bundle.
  • Add attribute: value is original child text node: copy tag's child text to output element's attribute. For example: <html:reset>Button Text<html:reset/> will output <input type="reset" value="Button Text">. All child elements inside <html:reset> will be ignore.
  • Add extra attribute: Add extra attribute to output. For example: <html:reset> always output a attribue type="reset"
  • Create child text node, text is attribute value: For example: <html:textarea value="${bean.foo}"/> will output <textarea>${bean.foo}</textarea>

XSLT template

This handler is removed since version 2.0.0.

Use XSLT translate the Tag to HTML output. If the tag <body-content> is JSP which could contain HTML or other tag lib, please add <com.beck.ep.wtool.CHILD_ELEMENT_CONTENT/> to indicate where the child element should be placed.

Resource bundle message

Find Java property file in the same project, then output the value of message entry

  • Message bundle attribute name - which resource bundle will be used. for example: bundle
  • Message key attribute name - the key value of message entry, for example: key
  • var attribute name - If this attribute value is not empty, the message will not display

<fmt:message bundle="myweb.i18n" key="com.beck.jsp.msg1"/>
<-- the entry value of 'com.beck.jsp.msg1' in property file myweb.i18n.property will be output -->

There are addition setting if the tag is design as JSTL fmt:bundle.

  • Element name - Bundle element's name, for example: bundle
  • Bundle attribute name - Attribute that specified which resource bundle will be used by all child tag, for example: basename
  • Prefix attribute name - This attribute value will be added to child <message> @key , for example: prefix
Here are example, for following code
<fmt:bundle basename="myweb.i18n" prefix="com.beck.jsp.">
<fmt:message key="msg1"/>
</fmt:bundle>
<-- the entry value of 'com.beck.jsp.msg1' in property file myweb.i18n.property will be output -->

Import other page

Import another file that can be opened by Structured Text Editor. The page file are loaded by one of following way:

  • Use attribute value to resolve
  • Always import from workspace file
The imported page support <jsp:doBody> tag. The visual part will rendered all child nodes of this tag, then replace the content of <jsp:doBody>.

For unknown file type, you have to add file association first. The detail steps can be could found here

Java Script

Create DOM objects using Java script to simulate the output of custom tag lib. More detail

www.000webhost.com