獲取Servlet原生API

一、請求session

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

二、處理方法app

    @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";
    }
相關文章
相關標籤/搜索