Config JSP Tag Library

Concept:

To resolved the custom tag such as <html:text property="beanProperty"/>

The visual part will get the uri attribute value in JSP taglib declartion. Then look up "Project taglib-uri <-> config name" mapping in Project Preference to get TLD config name. Finally, a TLD config of workspace global setting is used to render the tag.

In most case, there are two ways to declare taglib in JSP:

1) absolute URI : recommended, better for application maintenance.

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>

2) Relative URI : Usually used when .tld file is delived with application but not defined in web.xml <jsp-config>

<%@ taglib uri="/tags/mytag.tld" prefix="m"%>

The mapping in Project Preference is important if your JSP used the 2nd style.


Create/edit new TLD config

Name : Uniqued for identify the config name. Use the value of Tag library uri if you don't set parent config name.

Tag library uri : For reference only. We recommend you specify element text of \taglib\uri in .tld file

Parent config name : Specified parent config could include its Tag settings by default, For example:

The default config named "default_struts_bean" defined following Tag handlers: write, message, include...

If you create a config named "my_struts_bean" and set parent config name to "default_struts_bean". Then add a Tag handler : message.

When visual part render the tag <bean:message>, it will used the handler config under "my_struts_bean" and ignore the one in parent config.

When visual part render the tag <bean:write>, it will used the handler config of parent config "default_struts_bean".


Create/edit new TLD config via wizard

The TLD/Tag configuration required lots information, the best way is open a JSP that referenced the taglib. Right click on visual part and select "Create/update taglib config..."

The wizard will list all TLD in JSP, select one of them and input required information. If the tag library will produce HTML form element Select checkbox could compare tag attribute with basic FORM element and produce default value.


Create/edit Tag settings

Each Tag are mapping to \taglib\tag\name element in .tld file

Please view this page for more information...


Create/update by wizard

To create the config easily, right click on visual part and select "Create/update taglib config..." will launch a wizard.

The tag/attribute <name> in .tld file can be selected. The UI tooltip will display <description> if available.

www.000webhost.com