- 本项目静态资源由网络收集得来,并加以大范围修改
- 未经许可不得将本项目商用,如需商用请联系作者[email protected]
基于JavaWeb三层经典架构开发
- 前端对应View层,由JSP、JS、CSS实现
- 前端使用jsp页面展示,并通过EL表达式接收服务器打给浏览器的数据
- 使用js实现网页动态效果,通过jQuery简化操作,并实现前端的数据校验
- 使用Ajax技术完成前端用户名可用性校验、退出登录功能
- com.supermarket.web包对应Controller层,主要通过servlet实现
- 主要功能:接收前端请求,并根据需求交给com.supermarket.service处理
- com.supermarket.service包属于Model层
- 使用com.supermarket.service.UserService完成对用户数据的各种后端校验
- 使用com.supermarket.service.ValistrService完成生成验证码相关功能
- com.supermarket.dao包属于Model层
- 使用com.supermarket.service.UserDao完成对数据库user表的增删改查
- 调用JDBC连接MySQL,可自定义使用C3P0连接池或DBCP连接池
版本号 | 更新内容 | 上传时间 |
---|---|---|
0.1 |
|
2020年8月3日 |
0.1.1 |
|
2020年8月7日 |
0.1.2 |
|
2020年8月9日 |
0.2 |
|
2020年8月20日 |
0.2.1 |
|
2020年8月22日 |
0.2.2 |
|
2020年8月24日 |
- JDK版本:OpenJDK11
- 服务器:tomcat7.0.62
- 开发环境:IntelliJ Idea 2020.1.4
- HttpServletRequest的装饰者类HttpServletRequestDecorator中的getParameterMap重写方法中,不能在原地进行参数字符集修改,否则如果调用两次及以上该方法时会编码多次,造成乱码
- 对请求参数的拦截处理,如果用到装饰者模式,最好在一处完成。如果在多处完成会造成请求参数的重复处理,从而导致乱码或者拿到非预期的参数值
- 用户的登录信息最好保存到session域中,在0.2.1中的自动登录成功后误把user对象塞入到了request域,造成了重启服务器自动登录失效的bug。