public class I18Ns
extends java.lang.Object
Typical use:
Object old = I18Ns.setup(session, request, response);
try {
...
} finally {
I18Ns.cleanup(old);
}
Constructor and Description |
---|
I18Ns() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanup(javax.servlet.ServletRequest request,
java.lang.Object old) |
static void |
setPreferredTimeZone(javax.servlet.http.HttpSession hsess,
java.util.TimeZone timezone)
Sets the preferred timezone for the specified session.
|
static void |
setPreferredTimeZone(javax.servlet.ServletContext ctx,
java.util.TimeZone timezone)
Sets the preferred timezone for the specified servlet context.
|
static java.lang.Object |
setup(javax.servlet.http.HttpSession sess,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
java.lang.String charset)
Sets up the internationalization attributes, including locale
and time zone.
|
static java.lang.Object |
setup(Session sess,
javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
java.lang.String charset)
Sets up the internationalization attributes, including locale
and time zone.
|
public static final java.lang.Object setup(Session sess, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, java.lang.String charset)
sess
- the session. It cannot be null.charset
- the response's charset. If null or empty,
response.setCharacterEncoding won't be called, i.e., the container's
default is used.public static final java.lang.Object setup(javax.servlet.http.HttpSession sess, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, java.lang.String charset)
This method is used only for requests that don't
count on Session
.
Attributes.PREFERRED_LOCALE
and
Attributes.PREFERRED_TIME_ZONE
are set with the preferred
locale and timezone. If so, use it as the default.Attributes.PREFERRED_LOCALE
and
Attributes.PREFERRED_TIME_ZONE
are set with the preferred
locale and timezone. If so, use it as the default.Attributes.PREFERRED_LOCALE
and
Attributes.PREFERRED_TIME_ZONE
are set with the preferred
locale and timezone. If so, use it as the default.sess
- the HTTP session. It cannot be null.charset
- the response's charset. If null or empty,
response.setCharacterEncoding won't be called, i.e., the container's
default is used.public static final void cleanup(javax.servlet.ServletRequest request, java.lang.Object old)
public static final void setPreferredTimeZone(javax.servlet.http.HttpSession hsess, java.util.TimeZone timezone)
Default: null (no preferred timezone -- depending on browser's location).
timezone
- the preferred time zone. If null, it means no preferred timezonesetup(org.zkoss.zk.ui.Session, javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.lang.String)
public static final void setPreferredTimeZone(javax.servlet.ServletContext ctx, java.util.TimeZone timezone)
Default: null (no preferred timezone -- depending on browser's location).
timezone
- the preferred time zone. If null, it means no preferred timezonesetup(org.zkoss.zk.ui.Session, javax.servlet.ServletRequest, javax.servlet.ServletResponse, java.lang.String)
Copyright © 2005-2021 Potix Corporation. All Rights Reserved.