|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts.action.Action
org.apache.struts.webapp.example.BaseAction
org.apache.struts.webapp.example.LocaleAction
Change user's Struts @link(java.util.Locale).
Field Summary | |
private static String |
COUNTRY
Parameter for @link(java.util.Locale) country property. |
private static String |
FORWARD
Parameter for response forward name. |
private static String |
LANGUAGE
Parameter for @link(java.util.Locale) language property. |
private static String |
LOCALE_LOG
Logging message if LocaleAction is missing a target parameter. |
private static String |
PAGE
Parameter for response page URI. |
Fields inherited from class org.apache.struts.webapp.example.BaseAction |
log |
Fields inherited from class org.apache.struts.action.Action |
defaultLocale, servlet |
Constructor Summary | |
LocaleAction()
|
Method Summary | |
org.apache.struts.action.ActionForward |
execute(org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Change the user's Struts @link(java.util.Locale) based on request parameters for "language", "country". |
private boolean |
isBlank(String string)
Return true if parameter is null or trims to empty. |
Methods inherited from class org.apache.struts.webapp.example.BaseAction |
findFailure, findSuccess, getUserDatabase |
Methods inherited from class org.apache.struts.action.Action |
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String LANGUAGE
Parameter for @link(java.util.Locale) language property. ["language"]
private static final String COUNTRY
Parameter for @link(java.util.Locale) country property. ["country"]
private static final String PAGE
Parameter for response page URI. ["page"]
private static final String FORWARD
Parameter for response forward name. ["forward"]
private static final String LOCALE_LOG
Logging message if LocaleAction is missing a target parameter.
Constructor Detail |
public LocaleAction()
Method Detail |
private boolean isBlank(String string)
Return true if parameter is null or trims to empty.
string
- The string to text; may be null
public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
Change the user's Struts @link(java.util.Locale) based on request parameters for "language", "country". After setting the Locale, control is forwarded to an URI path indicated by a "page" parameter, or a forward indicated by a "forward" parameter, or to a forward given as the mappings "parameter" property. The response location must be specified one of these ways.
mapping
- The ActionMapping used to select this instanceform
- The optional ActionForm bean for this request (if any)request
- The HTTP request we are processingresponse
- The HTTP response we are creating
Exception
- if an input/output error or servlet exception occurs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |