首先获取ActionContext
ActionContext ctx = ActionContext.getContext();
//getAppliction()返回servletcontext,是一个代理Map,而不是直接的servletcontext了。
ctx.getAppliction().get("");
另一方法,让action实现对应的XxxxAware接口,如
ServletRequestAware
ActionContext ctx = ActionContext.getContext();
//getAppliction()返回servletcontext,是一个代理Map,而不是直接的servletcontext了。
ctx.getAppliction().get("");
另一方法,让action实现对应的XxxxAware接口,如
ServletRequestAware