Package com.sabratec.j2ee.framework.web.tags


package com.sabratec.j2ee.framework.web.tags
Overview

The purpose of this package is to provide the developer the ability to add "HTML like" tags to the JSP page. Though this is done without writing any code inside the tags, it is still possible to set dynamic contents to the tags.

This package contains tag library classes and a tag accessor which allows setting dynamic content to the HTML output of the tags.
The final HTML result of each tag is the matching HTML tag with dynamic content/attributes, added dynamically.

Each JSP page must be associated with a Java class that contains an instance of the tags accessor.
The tags accessor sets dynamic content to the tags.
The association is established by setting a root tag: <gx:html gx_context="">

Tip: If you don't set a context class the page will work in design mode, and will not be connected to a data source (such as ApplinX) in the context class.
The HTML tag class starts the life cycle of the page:
gx_onInit -> gx_onLoad -> Post back (submit) -> gx_preRender -> gx_onUnload
these are all functions where you can use the object instance of the tags accessor getTagsAccesor() in order to pass dynamic content to each tag.
The association to each tag is established by setting an ID to each tag, and specifying the ID of the tag in the tags accessor's various methods.

Using the Tag Library

To set a dynamic content to a tag for example, set the following code:

In SamplePage.JSP:
<gx:html gx_context="contexts.SamplePage">
...
<gx:input id=�UserName� cssClass=�field1�/>


In SamplePage.java:
String user = �newUser�; // can be retrieved from any data source.
getTagsAccesor().setTagContent(�UserName�, user)

The result will be:
<input id=�UserName� name=�UserName �class=�field1� value=�newUser�/>

Configuration
Note: The following configuration is ready for use in any ApplinX application for JSP.
Check that the tag library contains the following components:
  • gxframework.jar should be in WEB-INF/lib folder.
  • GXTag.tld should be in WEB-INF folder.
  • tags folder should be in WEB-INF/classes including a list of Java classes for each tag type.
  • WEB-INF/web.xml should contain the following declaration that imports the tag library:
    <taglib>
    <taglib-uri>com/sabratec/j2ee/framework/tags</taglib-uri>
    <taglib-location>/WEB-INF/GXTags.tld</taglib-location>
    </taglib>
  • Each JSP page should have the following prefix declaration for the tag library:
    <%@ taglib uri="com/sabratec/j2ee/framework/tags" prefix="gx" %>

The classes in this package are abstract in order to allow the developer to extend them easily.
For this purpose, in each new ApplinX project for JSP there is a tags folder in WEB-INF/classes, which contains Java classes. Each class in the tags folder inherits from an abstract tag class in the tag library.
Associating the tags to the tags' classes is done in GXTags.tld.
The tags project classes folder is associated to the GXTags.tld file (and not directly to the tag library classes) in order to have immediate affect when a developer changes the relevant tag (in the project's tags folder).
  • Class
    Description
    Deprecated.
    If your class contains any customization you should inherit from: com.sabratec.j2ee.framework.web.taglib.GXAnchorTag otherwise you may delete this class.
    Deprecated.
    <gx:body> tag is not required any more is jsp pages
    Deprecated.
    If your class contains any customization you should inherit from: GXCheckBoxTag otherwise you may delete this class.
    Deprecated.
    If your class contains any customization you should inherit from: GXFormTag otherwise you may delete this class.
    A generic tag that represents all label tags such as: span, div, p, font, b etc.
    Deprecated.
    If your class contains any customization you should inherit from: GXTableTag otherwise you may delete this class.
    Deprecated.
    If your class contains any customization you should inherit from: GXHtmlTag otherwise you may delete this class.
    Deprecated.
    If your class contains any customization you should inherit from: GXInputTag otherwise you may delete this class.
    Deprecated.
    If your class contains any customization you should inherit from: GXRadioButtonTag otherwise you may delete this class.
    Deprecated.
    If your class contains any customization you should inherit from: GXRadioButtonListTag otherwise you may delete this class.
    Deprecated.
    If your class contains any customization you should inherit from: GXSelectTag otherwise you may delete this class.
    This class is the abstract class for all the gx tags.
    This class is an alternative to the opening tag <gx:html> : GXAbstractHtmlTag.
    This class is an alternative to the closing tag </gx:html> : GXAbstractHtmlTag.
     
    This class which can be accessed from the context classes as getTagsAccesor(),
    provides various methods for updating the various gx tags.
    It serves both simple tags using setTagContent,setTagAttribute, or complex tags such as combobox, radio buttons and table.
    This class is the root of a JSP Include file and the tag that initializes and activates the JSP Include context class.
    Internal Util class for common tasks of the package.