开发者学堂课程【Java Web项目实战2:图书商城:用户模块之退出功能】学习笔记,与课程紧密联系,让用户快速学习知识。
课程地址:https://developer.aliyun.com/learning/course/35
用户模块之退出功能
1.退出流程:top.jsp→ Userservlet进quit()→ login.jsp
quit():把session 销毁!
2.public class UserServlet extends BaseServlet {
private UserService userService = new UsersService();
/**
*退出功能
*@param request
*@param response
* @return
* @throws ServletException
* throws IOException
*/
public String quit(HttpServletRequest request,HttpservletResponse response)
throws ServletException,IOException{
request.getSession().invalidate();
return "r:/index.jsp";
}