nl.gx.webmanager.taglib
Class TextTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.SimpleTagSupport
      extended by nl.gx.webmanager.taglib.TextTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag

public class TextTag
extends javax.servlet.jsp.tagext.SimpleTagSupport

Implements the wm:text tag. This tag looks up the text value defined for a language label as configured in GX Webmanager. The configuration can be found in the menu 'Configure > Language Labels' in the WM editor environment. If the var attribute is set, the result is bound to this variable, else the result of the lookup is printed.
Example of usage:

 < wm:text var="submitText" label="wm_language.form_submit" />
 < input type="submit" name="${submitText}" />
 
In the example above the text defined for the label "wm_language.form_submit" is retrieved for the current language. A button using this text is displayed. When the label does not exist, a new label is created automatically with the same name. The new label can only consist of the following characters:
 [0-9,a-z,A-Z,-,_]
 


Constructor Summary
TextTag()
           
 
Method Summary
 void doTag()
           
protected  java.lang.String getLabel()
          Return the label for which the text must be retrieved.
protected  java.lang.String getVar()
          Return name of the JSP variable to which the text will be assigned or null, if not set.
 void setLabel(java.lang.String label)
          Specifies the label for which the text must be retrieved.
 void setVar(java.lang.String var)
          Specifies the JSP variable to store the result in.
 
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextTag

public TextTag()
Method Detail

setVar

public void setVar(java.lang.String var)
Specifies the JSP variable to store the result in.

Parameters:
var - name of the variable to which the text will be assigned.

getVar

protected java.lang.String getVar()
Return name of the JSP variable to which the text will be assigned or null, if not set.

Returns:
name of the variable to which the text will be assigned or null if not set.

setLabel

public void setLabel(java.lang.String label)
Specifies the label for which the text must be retrieved.

Parameters:
label - name of the language label

getLabel

protected java.lang.String getLabel()
Return the label for which the text must be retrieved.

Returns:
the language label.

doTag

public void doTag()
           throws javax.servlet.jsp.JspException
Specified by:
doTag in interface javax.servlet.jsp.tagext.SimpleTag
Overrides:
doTag in class javax.servlet.jsp.tagext.SimpleTagSupport
Throws:
javax.servlet.jsp.JspException


Copyright © 2007-2011 GX Software BV. All Rights Reserved.