摘要: web应用中需要访问的ServletAPI,通常只有HttpServletRequest,HttpSession,ServletContext三个,这三个接口分别代表jsp内置对象中的request,session,application,Struts2没有与任何Servlet接口耦合,所以很方便的访问Servlet API。 第一种: Struts2提供了一个ActionContext... 阅读全文
posted @ 2015-05-27 22:43 珍惜阳光 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 第一种: 通常用ApplicationContext来调用Spring配置文件中的一些Bean,所以首先创建Spring上下文容器。 ApplicationContext ac = (ApplicationContext) invocation.getInvocationContext().getApplication().get(WebApplicationContext.ROOT_WEB_AP... 阅读全文
posted @ 2015-05-27 22:05 珍惜阳光 阅读(758) 评论(0) 推荐(0) 编辑