org.nfis.gdas.service
Class SetTextPropertyTagLib
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.nfis.gdas.service.SetTextPropertyTagLib
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
public class SetTextPropertyTagLib
- extends javax.servlet.jsp.tagext.TagSupport
This class handles the setting and changing of language properties objects
in the users session.
- If the request includes a
LANGUAGE parameter,
the requested language (value of the language parameter) Properties
object will be set in the session.
- If there is no text file set in the session and there is a
ProfileCookie present the language will be set to
the value returned by ProfileCookie.getLanguage().
- If there is no language parameter specified and there is not already
a Properties file set in the session, the Properties object will be
set to English.
- If there is a change of language, the language is being set for the
first time, or there is no ProfileCookie present, a ProfileCookie will be
sent back to the client.
The Properties file referenced in the session by the TEXT
key contains the text for the page.
For this class to work there:
- must be two
Properties objects containing the
applications text set in the ServletContext, one French the other English,
that can be retrieved using the name TEXT with the method
ServletContext.getAttribute(java.lang.String).
- may be a parameter passed in the
HttpServletRequest which has the name
LANGUAGE and the values
ProfileCookie.EN or
ProfileCookie.FR. If it is present the users
language will be changed to its value.
- may be a
ProfileCookie present in the
request. If present the user's language will be changed to the value
returned from ProfileCookie.getLanguage().
- See Also:
- Serialized Form
|
Field Summary |
static java.lang.String |
LANGUAGE
The name of the parameter when requesting language be changed. |
static java.lang.String |
TEXT
The name of the text file stored in the users session. |
| Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
id, pageContext |
| Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
EVAL_BODY_AGAIN |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LANGUAGE
public static final java.lang.String LANGUAGE
- The name of the parameter when requesting language be changed. The value
is "language".
- See Also:
- Constant Field Values
TEXT
public static final java.lang.String TEXT
- The name of the text file stored in the users session. It is used to
retrieve the text from the session or set it in the session using
HttpSession.getAttribute(java.lang.String) or
HttpSession.setAttribute(java.lang.String, java.lang.Object).
The value is "text".
- See Also:
- Constant Field Values
SetTextPropertyTagLib
public SetTextPropertyTagLib()
doStartTag
public int doStartTag()
- Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag- Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport