用纯jsp实现用户的登录、注册与退出
用户的登录、注册和退出是一个系统最常见的功能,现将各功能用jsp代码表示出来
用户的登录:
其中connDB是数据库连接类,将用户名username放入session中
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %><%session.removeAttribute("username"); //清空Session变量response.sendRedirect("index.jsp");%>