Struts2实现Preparable接口
  实现preparable接口,实现public void prepare() throws Exception 方法。当你访问某问action指定方法之前,最先执行prepare()。这里边可以写些准备工作的代码
1 public void prepare() throws Exception {
2         
3         request = ServletActionContext.getRequest();
4         requestIp = getIpAddr(request);
5         response = ServletActionContext.getResponse();
6         session = request.getSession();
7         application = ServletActionContext.getServletContext();
8     }
View Code

相关文章:

  • 2021-07-30
  • 2021-11-17
  • 2021-08-06
  • 2021-10-06
  • 2022-12-23
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-25
  • 2021-05-20
  • 2021-08-12
相关资源
相似解决方案