This section describes how to implement a JSP tag handler and how to use it in the IBM® WebSphere® Multichannel Bank Transformation Toolkit framework.
After the new JSP tag for a widget has been generated into a JSP file, it still requires a tag handler to generate the dynamic HTML content for this new JSP tag at runtime.
Is provided for a handler with handles tag that do not contain sub-tags or inner content, such as button or label tag.
protected void initAttributes(){ super.initAttributes(); attributes.put("dojoType", "com.ibm.btt.dijit.Account"); }
The com.ibm.btt.dojo.tag.AbstractBodyTag class is provided for handler which handles tag contains sub-tags or inner content. For example, table tag may have nested column tags to describe each column in table.
com.ibm.btt.dojo.tag.AbstractBodyTag handles the logic of generating content for sub-tags, so extending the com.ibm.btt.dojo.tag.AbstractBodyTag class is similar to extending the com.ibm.btt.dojo.tag.AbstractSimpleTag class. Both the initAttributes() and the getTagName() methods must be overridden.
In addition to the protected void beforeGenerateTag(StringBuffer buffer) and the protected void afterGenerateTag(StringBuffer buffer) methods, the protected void afterGenerateStartTag(StringBuffer buffer, Map<String, String> attributes) method is also provided for a technical developer to extend.
As indicated by name, the protected void beforeGenerateTag(StringBuffer buffer) method is used for subclass to inject the code after AbstractBodyTag generating start tag.
To enable the implemented JSP tag, handler can be used by WebSphere Multichannel Bank Transformation Toolkit at runtime. A technical developer must create a new JSP lib file to support that tags that have been created for new widgets. The file follows standard JSP tag library schema. You can access http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd for more information.