package com.aspboy.base.action;
import java.util.Collection;
import com.opensymphony.xwork.Action;
import com.opensymphony.xwork.ActionContext;
import com.opensymphony.xwork.ActionInvocation;
import com.opensymphony.xwork.ValidationAware;
/**
* @deprecated Class ActionUtils is deprecated
*/
public class ActionUtils {
private ActionUtils() {
}
public static Action getAction() {
if (ActionContext.getContext().getValueStack().peek() instanceof Action)
return (Action) ActionContext.getContext().getValueStack().peek();
ActionInvocation ai = ActionContext.getContext().getActionInvocation();
if (ai != null)
return (Action) ai.getAction();
else
return null;
}
public static Collection getActionMessages() {
Action a = getAction();
if (a != null && (a instanceof ValidationAware))
return ((ValidationAware) a).getActionMessages();
else
return null;
}
}