Struts2 - 与 Servlet 耦合的访问方式访问web资源
摘要:
• 直接访问 Servlet API 将使 Action 与 Servlet 环境耦合在一起, 测试时需要有 Servlet 容器, 不便于对 Action 的单元测试. • 直接获取 HttpServletRequest 对象: – ServletActionContext.getRequest() • 直接获取 HttpSession... 阅读全文
posted @ 2018-04-03 22:29 pjlhf 阅读(109) 评论(0) 推荐(0) 编辑