Package com.sun.faces.taglib.jsf_core
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
-
Constructor Summary
Constructors Constructor Description LoadBundleTag()
-
Method Summary
Modifier and Type Method Description int
doStartTag()
Load theResourceBundle
named by ourbasename
property.void
release()
Release references to any acquired resources.void
setBasename(jakarta.el.ValueExpression basename)
Set the base name of theResourceBundle
to be loaded.void
setVar(String var)
Set the name of the attribute in the request scope under which to store theResourceBundle
Map
.
-
Constructor Details
-
LoadBundleTag
public LoadBundleTag()
-
-
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
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.JspExceptionLoad the
Wrap it in an immutableResourceBundle
named by ourbasename
property.Map
implementation and store theMap
in the request attr set of under the key given by ourvar
property.- Specified by:
doStartTag
in interfacejakarta.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjakarta.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 interfacejakarta.servlet.jsp.tagext.Tag
- Overrides:
release
in classjakarta.servlet.jsp.tagext.TagSupport
-