Class LoadBundleTag

java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
com.sun.faces.taglib.jsf_core.LoadBundleTag
All Implemented Interfaces:
jakarta.servlet.jsp.tagext.IterationTag, jakarta.servlet.jsp.tagext.JspTag, jakarta.servlet.jsp.tagext.Tag, Serializable

public class LoadBundleTag
extends jakarta.servlet.jsp.tagext.TagSupport

Tag action that loads the specified ResourceBundle as a Map into the request scope of the current FacesContext.

The user is discouraged from using multiple dot syntax in their resource bundle keys. For example, for the bundle loaded under the var msgs, this key: index.page.title is discouraged. If your application requires this syntax for resource bundle keys, they may be referred to in the page with a syntax like this: #{msgs["index.page.title"]}.

See Also:
Serialized Form
  • Field Summary

    Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport

    id, pageContext

    Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag

    EVAL_BODY_AGAIN

    Fields inherited from interface jakarta.servlet.jsp.tagext.Tag

    EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
  • Constructor Summary

    Constructors 
    Constructor Description
    LoadBundleTag()  
  • Method Summary

    Modifier and Type Method Description
    int doStartTag()
    Load the ResourceBundle named by our basename property.
    void release()
    Release references to any acquired resources.
    void setBasename​(jakarta.el.ValueExpression basename)
    Set the base name of the ResourceBundle to be loaded.
    void setVar​(String var)
    Set the name of the attribute in the request scope under which to store the ResourceBundle Map.

    Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport

    doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setBasename

      public void setBasename​(jakarta.el.ValueExpression basename)

      Set the base name of the ResourceBundle to be loaded.

      Parameters:
      basename - the ValueExpression which will resolve the basename
    • setVar

      public void setVar​(String var)

      Set the name of the attribute in the request scope under which to store the ResourceBundle Map.

      Parameters:
      var - the variable name to export the loaded ResourceBundle to
    • doStartTag

      public int doStartTag() throws jakarta.servlet.jsp.JspException

      Load the ResourceBundle named by our basename property.

      Wrap it in an immutable Map implementation and store the Map in the request attr set of under the key given by our var property.
      Specified by:
      doStartTag in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      doStartTag in class jakarta.servlet.jsp.tagext.TagSupport
      Throws:
      jakarta.servlet.jsp.JspException - if a JSP error occurs
    • release

      public void release()

      Release references to any acquired resources.

      Specified by:
      release in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      release in class jakarta.servlet.jsp.tagext.TagSupport