Method from com.opensymphony.xwork2.ActionContext Detail: |
public Object get(String key) {
return context.get(key);
}
Returns a value that is stored in the current ActionContext by doing a lookup using the value's key. |
public ActionInvocation getActionInvocation() {
return (ActionInvocation) get(ACTION_INVOCATION);
}
Gets the action invocation (the execution state). |
public Map<String, Object> getApplication() {
return (Map< String, Object >) get(APPLICATION);
}
Returns a Map of the ServletContext when in a servlet environment or a generic application level Map otherwise. |
public Container getContainer() {
return (Container) get(CONTAINER);
}
Sets the container for this request |
public static ActionContext getContext() {
return (ActionContext) actionContext.get();
// Don't do lazy context creation, as it requires container; the creation of which may
// precede the context creation
//if (context == null) {
// ValueStack vs = ValueStackFactory.getFactory().createValueStack();
// context = new ActionContext(vs.getContext());
// setContext(context);
//}
}
Returns the ActionContext specific to the current thread. |
public Map<String, Object> getContextMap() {
return context;
}
|
public Map<String, Object> getConversionErrors() {
Map< String, Object > errors = (Map) get(CONVERSION_ERRORS);
if (errors == null) {
errors = new HashMap< String, Object >();
setConversionErrors(errors);
}
return errors;
}
Gets the map of conversion errors which occurred when executing the action. |
public T getInstance(Class<T> type) {
Container cont = getContainer();
if (cont != null) {
return cont.getInstance(type);
} else {
throw new XWorkException("Cannot find an initialized container for this request.");
}
}
|
public Locale getLocale() {
Locale locale = (Locale) get(LOCALE);
if (locale == null) {
locale = Locale.getDefault();
setLocale(locale);
}
return locale;
}
Gets the Locale of the current action. If no locale was ever specified the platform's
default locale is used. |
public String getName() {
return (String) get(ACTION_NAME);
}
Gets the name of the current Action. |
public Map<String, Object> getParameters() {
return (Map< String, Object >) get(PARAMETERS);
}
Returns a Map of the HttpServletRequest parameters when in a servlet environment or a generic Map of
parameters otherwise. |
public Map<String, Object> getSession() {
return (Map< String, Object >) get(SESSION);
}
Gets the Map of HttpSession values when in a servlet environment or a generic session map otherwise. |
public ValueStack getValueStack() {
return (ValueStack) get(VALUE_STACK);
}
Gets the OGNL value stack. |
public void put(String key,
Object value) {
context.put(key, value);
}
Stores a value in the current ActionContext. The value can be looked up using the key. |
public void setActionInvocation(ActionInvocation actionInvocation) {
put(ACTION_INVOCATION, actionInvocation);
}
Sets the action invocation (the execution state). |
public void setApplication(Map<String, Object> application) {
put(APPLICATION, application);
}
Sets the action's application context. |
public void setContainer(Container cont) {
put(CONTAINER, cont);
}
Gets the container for this request |
public static void setContext(ActionContext context) {
actionContext.set(context);
}
Sets the action context for the current thread. |
public void setContextMap(Map<String, Object> contextMap) {
getContext().context = contextMap;
}
Sets the action's context map. |
public void setConversionErrors(Map<String, Object> conversionErrors) {
put(CONVERSION_ERRORS, conversionErrors);
}
Sets conversion errors which occurred when executing the action. |
public void setLocale(Locale locale) {
put(LOCALE, locale);
}
Sets the Locale for the current action. |
public void setName(String name) {
put(ACTION_NAME, name);
}
Sets the name of the current Action in the ActionContext. |
public void setParameters(Map<String, Object> parameters) {
put(PARAMETERS, parameters);
}
Sets the action parameters. |
public void setSession(Map<String, Object> session) {
put(SESSION, session);
}
Sets a map of action session values. |
public void setValueStack(ValueStack stack) {
put(VALUE_STACK, stack);
}
Sets the OGNL value stack. |