获取Servlet原生API

1、请求

<a href="param/test1">Servlet原生API</a>

2、处理方法

    @RequestMapping("/param/test1")
    public String testParam6(HttpServletRequest request, HttpServletResponse response) {
        HttpSession session = request.getSession();
        ServletContext servletContext = session.getServletContext();
        System.out.println(request);
        System.out.println(response);
        System.out.println(session);
        System.out.println(servletContext);
        return "success";
    }

 

posted @ 2020-02-26 21:08  牛牛的自留地  阅读(218)  评论(0编辑  收藏  举报