BaseController

  继承此类使所有Controller使用HttpServletRequest和HttpServletResponse。

public class BaseController {
    protected HttpServletRequest request;

    protected HttpServletResponse response;

    protected HttpSession session;

    @ModelAttribute
    public void setReqAndRes(HttpServletRequest request, HttpServletResponse response) {

        this.request = request;

        this.response = response;

        this.session = request.getSession();

    }
}
上一篇:C++ Builder XE扫描读取文件夹内所有子文件夹路径


下一篇:Delphi TStringList DBMemo 文字处理 删除多余换页符