1、编写前端页面
2、设置首页
<welcome-file-list>
<welcome-file>/jsp/login.jsp</welcome-file>
</welcome-file-list>
3、编写dao层用户登陆的接口
public interface UserDao {
public User getLoginUser(Connection connection,String user) throws SQLException;
}
4、编写dao层登陆用户的接口
public class UserImpl implements UserDao{
public User getLoginUser(Connection connection, String username) throws SQLException {
User user = null;
PreparedStatement pstm = null;
ResultSet rs=null;
if(connection!=null){
String sql = "select * from smbms_user where userCode=?";
Object[] params = {
username};
rs = BaseDao.execute(connection,pstm,rs,sql,para