ServletContext servletContext = filterConfig.getServletContext();
ActionContext ctx = ServletActionContext.getActionContext(req);
if (ctx == null) {
// ok, one isn't associated with the request, so let's get a ThreadLocal one (which will create one if needed)
OgnlValueStack vs = new OgnlValueStack();
vs.getContext().putAll(Dispatcher.getInstance().createContextMap(req, res, null, servletContext));
ctx = new ActionContext(vs.getContext());
if (ctx.getActionInvocation() == null) {
// put in a dummy ActionSupport so basic functionality still works
ActionSupport action = new ActionSupport();
vs.push(action);
ctx.setActionInvocation(new DummyActionInvocation(action));
}
}
// delegate to the actual page decorator