怎样在退出时关闭session

[size=xx-small]public class LogoutAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) throws IOException { HttpSession session = request.getSession();
session.removeAttribute("username");
session.removeAttribute("id");
session.invalidate();
return mapping.findForward("success");

}
}
[/size]

你可能感兴趣的:(jsp servlet)