Struts2 与普通的java内通信 也就是所谓的 Action类 来获取servlet中request对象和response对象
2021-01-05 04:28
标签:str info image java src http void bsp Servle 方法1: 方法2 在普通java类中通过ServletActioContext对象来获取 Struts2 与普通的java内通信 也就是所谓的 Action类 来获取servlet中request对象和response对象 标签:str info image java src http void bsp Servle 原文地址:https://www.cnblogs.com/gaoSJ/p/12981387.htmlimplements ServletRequestAware, ServletResponseAware
public class Hello implements ServletRequestAware, ServletResponseAware {
private HttpServletRequest request;
private HttpServletResponse response;
@Override
public void setServletRequest(HttpServletRequest httpServletRequest) {
this.request = httpServletRequest;
}
@Override
public void setServletResponse(HttpServletResponse httpServletResponse) {
this.response = httpServletResponse;
}
}
上一篇:java之面向对象(中)
下一篇:查看Python对象的属性
文章标题:Struts2 与普通的java内通信 也就是所谓的 Action类 来获取servlet中request对象和response对象
文章链接:http://soscw.com/index.php/essay/40182.html