Tag library name: util-taglib


Index of Tags and Functions.
Tags
  1. active-filter.
  2. active-substring.
  3. doonlyonce.
  4. inert-filter.
  5. inert-substring.
  6. silent.



Authors:
NameInstitutione-mailRole
E. Reinaldo Barreiro Technical University of Eindhoven (TU/e) info@mathdox.org Main author



Description:

Here we group some heterogeneous utility tags.




Download and Install:

Download:

The whole tag library project is available for dowloading, as tar.gz or as a zip file, here .

General INSTALL information:

This tag library is designed to be used in JSP pages compliant with the JSP 2.0 specification.

To get this tag library working you will have to copy the jar files

Jar fileDownloadDescription
util-taglib.jardownloadThe tag library jar file.

to the WEB-INF/lib/ directory on your web application.

NOTE: We advise you to use the versions of additional jar files comming with the tag library and not to download them directly from other of our related projects. By doing so, you may create imcompatibilities: though we will do our best to make sure a tag library is using the latest version of a jar file.

You will also need to copy the tld file util-taglib.tld to somewhere in the WEB-INF/ directory, for instance to WEB-INF/ itselft, and add to the web.xml file, in the part corresponding to the tag libraries, the following lines:

<taglib>
    <taglib-uri>URI identifying your tag lib</taglib-uri>

    <taglib-location>/WEB-INF/util-taglib.tld</taglib-location>
</taglib>
                            

For more information on how to modify the web.xml file peruse the documentation coming with your WEB server/container. For information on how to use tag extensions on your own JSP pages consult the JSP 2.0 specification.

Tag specific INSTALL information:

None




Tags


1-active-filter (tag).
Description

Filters the body replacing


            <, <, >, " and &
        

with the corresponding escaping unicode representations. The body is evaluated, that mean it is evaluated as other JSP code and the result is then filtered. See also inert-filter

Body Content:

JSP

Tag Class:

nl.tue.win.riaca.taglib.util.FilterTag



Attributes:
This tag has no attributes.


Examples:
Snippet 1:
      
        <!--  The body is executed the parameters replaced and then filtered
--> <pre> <util:active-filter> <OMOBJ> <OMA> <OMS name="cd" name="plus"/> <OMI><c:out value="${param.a}"/></OMI> <OMI><c:out value="${param.b}"/></OMI> </OMA> </OMOBJ> </util:active-filter> </pre>




2-active-substring (tag).
Description

Returns the substring (from the body) after the start attribute and before the end attribute. The body is evaluated.

Body Content:

JSP

Tag Class:

nl.tue.win.riaca.taglib.util.SubStringTag



Attributes:
NameRequiredDynamicDescription
endfalsetrue The ending substring. If missing the end is assumed.
startfalsetrue The starting substring. If missing the beginnig is assumed.


Examples:
Snippet 1:
      
        <!--  The body is executed (the parameters replaced). -->
        <util:active-substring start="<OMOBJ>" end="</OMOBJ>">

          <OMOBJ>
            <OMA>
              <OMS name="cd" name="plus"/>
              <OMI><c:out value="${param.a}"/></OMI>
              <OMI><c:out value="${param.b}"/></OMI>

            </OMA>
           </OMOBJ>
        </util:active-substring>        
      




3-doonlyonce (tag).
Description

This tag executes its body only once. You may have several doonlyonce tags in a page they are identified by the var attribute (a variable is created and placed in the scope to know the tag has already been executed once). By default the attribute scope is set to page, but you can also use session, request and application. The attribute scope determines the extend of the uniqueness of the doonlyonce tag (once per page, once per request, once per session or once per application.

Body Content:

JSP

Tag Class:

nl.tue.win.riaca.taglib.util.DoOnlyOnceTag



Attributes:
NameRequiredDynamicDescription
scopefalsetrue The scope of the action. The default value is page.
vartruefalse The variable name identifying this action (in a certain scope).


Examples:
Snippet 1:
      
        <!-- The body is erased after execution. -->
        <util:doonlyonce var="COMPUTATION_1" scope="session">

            <eval value="${GapPhrasebook}" method="EVAL">
                <OMOBJ>
                    <OMA>
                        <OMS name="plus" cd="arith1"/>
                        <OMI>${param.A}</OMI>

                        <OMI>${param.B}</OMI>
                    </OMA>
                </OMOBJ>
            </eval>
        </util:doonlyonce>        
      





4-inert-filter (tag).
Description

Filters the body replacing

            <, <, >, " and &
        

with the corresponding escaping unicode representations. The body is not evaluated, it is passed as a string to the tag. See also active-filter

Body Content:

tagdependent

Tag Class:

nl.tue.win.riaca.taglib.util.FilterTag



Attributes:
This tag has no attributes.


Examples:
Snippet 1:
      
        <!--  The body is not executed. So, the parameters are not replaced.
--> <pre> <util:active-filter> <OMOBJ> <OMA> <OMS name="cd" name="plus"/> <OMI><c:out value="${param.a}"/></OMI> <OMI><c:out value="${param.b}"/></OMI> </OMA> </OMOBJ> </util:active-filter> </pre>




5-inert-substring (tag).
Description

Returns the substring (from the body) after the start attribute and before the end attribute. The body is not evaluated.

Body Content:

tagdependent

Tag Class:

nl.tue.win.riaca.taglib.util.SubStringTag



Attributes:
NameRequiredDynamicDescription
endfalsetrue The ending substring. If missing the end is assumed.
startfalsetrue The starting substring. If missing the beginnig is assumed.


Examples:
Snippet 1:
      
        <!--  The body is not executed (the parameters not replaced). -->
        <util:inert-substring start="<OMOBJ>" end="</OMOBJ>">

          <OMOBJ>
            <OMA>
              <OMS name="cd" name="plus"/>
              <OMI><c:out value="${param.a}"/></OMI>
              <OMI><c:out value="${param.b}"/></OMI>

            </OMA>
           </OMOBJ>
        </util:inert-substring>        
      




6-silent (tag).
Description

Erases its contents after executing it. Very useful if you are doing some computations adn you don't want them to appear in your page.

Body Content:

JSP

Tag Class:

nl.tue.win.riaca.taglib.util.SilentTag



Attributes:
This tag has no attributes.


Examples:
Snippet 1:
      
        <!-- The body is erased after execution. -->
        <util:silent>
            <eval value="${GapPhrasebook}" method="EVAL">

                <OMOBJ>
                    <OMA>
                        <OMS name="plus" cd="arith1"/>
                        <OMI>${param.A}</OMI>
                        <OMI>${param.B}</OMI>

                    </OMA>
                </OMOBJ>
            </eval>
        </util:silent>