登录流程图
1.编写前端页面
2.设置欢迎页
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
css无法显示问题
<%-- css无法显示问题 补充css显示问题:看是否自己在过滤器那里写上了response.setcontenttype(“text/html;utf-8”), 如果写上了login.jsp页面加载的时候css就会无效,因为这里需要的是html/css, 就得在过滤器哪里把上面的话注释掉;还有一种方案是将JSP页面的 <!DOCTYPE html>注释掉可以正常显示css样式 --%>
3.编写dao层登录的接口
public interface UserDao { //得到要登录的用户 public User getLoginUser(Connection connection, String userCode) throws SQLException; }
4.编写dao接口的实现类
public class UserDaoImpl implements UserDao{ //得到要登录的用户 @Override public User getLoginUser(Connection connection, String userCode) throws SQLException { PreparedStatement pstm =null;