Class Config
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of configuration setting for fallback localestatic final String
Name of configuration setting for application- (as opposed to browser-) based preferred localestatic final String
Name of configuration setting for i18n localization contextstatic final String
Name of localization setting for time zonestatic final String
Name of configuration setting for SQL data sourcestatic final String
Name of configuration setting for maximum number of rows to be included in SQL query result -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
find
(PageContext pageContext, String name) Finds the value associated with a specific configuration setting identified by its context initialization parameter name.static Object
get
(HttpSession session, String name) Looks up a configuration variable in the "session" scope.static Object
get
(PageContext pageContext, String name, int scope) Looks up a configuration variable in the given scope.static Object
get
(ServletContext context, String name) Looks up a configuration variable in the "application" scope.static Object
get
(ServletRequest request, String name) Looks up a configuration variable in the "request" scope.static void
remove
(HttpSession session, String name) Removes a configuration variable from the "session" scope.static void
remove
(PageContext pageContext, String name, int scope) Removes a configuration variable from the given scope.static void
remove
(ServletContext context, String name) Removes a configuration variable from the "application" scope.static void
remove
(ServletRequest request, String name) Removes a configuration variable from the "request" scope.static void
set
(HttpSession session, String name, Object value) Sets the value of a configuration variable in the "session" scope.static void
set
(PageContext pageContext, String name, Object value, int scope) Sets the value of a configuration variable in the given scope.static void
set
(ServletContext context, String name, Object value) Sets the value of a configuration variable in the "application" scope.static void
set
(ServletRequest request, String name, Object value) Sets the value of a configuration variable in the "request" scope.
-
Field Details
-
FMT_LOCALE
Name of configuration setting for application- (as opposed to browser-) based preferred locale- See Also:
-
FMT_FALLBACK_LOCALE
Name of configuration setting for fallback locale- See Also:
-
FMT_LOCALIZATION_CONTEXT
Name of configuration setting for i18n localization context- See Also:
-
FMT_TIME_ZONE
Name of localization setting for time zone- See Also:
-
SQL_DATA_SOURCE
Name of configuration setting for SQL data source- See Also:
-
SQL_MAX_ROWS
Name of configuration setting for maximum number of rows to be included in SQL query result- See Also:
-
-
Constructor Details
-
Config
public Config()
-
-
Method Details
-
get
Looks up a configuration variable in the given scope.The lookup of configuration variables is performed as if each scope had its own name space, that is, the same configuration variable name in one scope does not replace one stored in a different scope.
- Parameters:
pageContext
- Page context in which the configuration variable is to be looked upname
- Configuration variable namescope
- Scope in which the configuration variable is to be looked up- Returns:
- The
java.lang.Object
associated with the configuration variable, or null if it is not defined.
-
get
Looks up a configuration variable in the "request" scope.The lookup of configuration variables is performed as if each scope had its own name space, that is, the same configuration variable name in one scope does not replace one stored in a different scope.
- Parameters:
request
- Request object in which the configuration variable is to be looked upname
- Configuration variable name- Returns:
- The
java.lang.Object
associated with the configuration variable, or null if it is not defined.
-
get
Looks up a configuration variable in the "session" scope.The lookup of configuration variables is performed as if each scope had its own name space, that is, the same configuration variable name in one scope does not replace one stored in a different scope.
- Parameters:
session
- Session object in which the configuration variable is to be looked upname
- Configuration variable name- Returns:
- The
java.lang.Object
associated with the configuration variable, or null if it is not defined, if session is null, or if the session is invalidated.
-
get
Looks up a configuration variable in the "application" scope.The lookup of configuration variables is performed as if each scope had its own name space, that is, the same configuration variable name in one scope does not replace one stored in a different scope.
- Parameters:
context
- Servlet context in which the configuration variable is to be looked upname
- Configuration variable name- Returns:
- The
java.lang.Object
associated with the configuration variable, or null if it is not defined.
-
set
Sets the value of a configuration variable in the given scope.Setting the value of a configuration variable is performed as if each scope had its own namespace, that is, the same configuration variable name in one scope does not replace one stored in a different scope.
- Parameters:
pageContext
- Page context in which the configuration variable is to be setname
- Configuration variable namevalue
- Configuration variable valuescope
- Scope in which the configuration variable is to be set
-
set
Sets the value of a configuration variable in the "request" scope.Setting the value of a configuration variable is performed as if each scope had its own namespace, that is, the same configuration variable name in one scope does not replace one stored in a different scope.
- Parameters:
request
- Request object in which the configuration variable is to be setname
- Configuration variable namevalue
- Configuration variable value
-
set
Sets the value of a configuration variable in the "session" scope.Setting the value of a configuration variable is performed as if each scope had its own namespace, that is, the same configuration variable name in one scope does not replace one stored in a different scope.
- Parameters:
session
- Session object in which the configuration variable is to be setname
- Configuration variable namevalue
- Configuration variable value
-
set
Sets the value of a configuration variable in the "application" scope.Setting the value of a configuration variable is performed as if each scope had its own namespace, that is, the same configuration variable name in one scope does not replace one stored in a different scope.
- Parameters:
context
- Servlet context in which the configuration variable is to be setname
- Configuration variable namevalue
- Configuration variable value
-
remove
Removes a configuration variable from the given scope.Removing a configuration variable is performed as if each scope had its own namespace, that is, the same configuration variable name in one scope does not impact one stored in a different scope.
- Parameters:
pageContext
- Page context from which the configuration variable is to be removedname
- Configuration variable namescope
- Scope from which the configuration variable is to be removed
-
remove
Removes a configuration variable from the "request" scope.Removing a configuration variable is performed as if each scope had its own namespace, that is, the same configuration variable name in one scope does not impact one stored in a different scope.
- Parameters:
request
- Request object from which the configuration variable is to be removedname
- Configuration variable name
-
remove
Removes a configuration variable from the "session" scope.Removing a configuration variable is performed as if each scope had its own namespace, that is, the same configuration variable name in one scope does not impact one stored in a different scope.
- Parameters:
session
- Session object from which the configuration variable is to be removedname
- Configuration variable name
-
remove
Removes a configuration variable from the "application" scope.Removing a configuration variable is performed as if each scope had its own namespace, that is, the same configuration variable name in one scope does not impact one stored in a different scope.
- Parameters:
context
- Servlet context from which the configuration variable is to be removedname
- Configuration variable name
-
find
Finds the value associated with a specific configuration setting identified by its context initialization parameter name.For each of the JSP scopes (page, request, session, application), get the value of the configuration variable identified by
name
using methodget()
. Return as soon as a non-null value is found. If no value is found, get the value of the context initialization parameter identified byname
.- Parameters:
pageContext
- Page context in which the configuration setting is to be searchedname
- Context initialization parameter name of the configuration setting- Returns:
- The
java.lang.Object
associated with the configuration setting identified byname
, or null if it is not defined.
-