View Code? Open in Web Editor
NEW
This project forked from ty1-stu/web-dev-quickstart
web-dev-quickstart
Java 71.06%
HTML 24.81%
CSS 4.13%
web-dev-quickstart's Introduction
- Servlet的层级,实现方式
- request取请求参数
- 请求乱码的处理
- 服务器端跳转、传参
- response的使用
- 响应乱码的处理
- 客户端跳转、传参
- session的概念和用法
- cookie的概念和用法
- 采用合理的布局和样式、图标等优化页面
- login.html输入用户名和密码
![Snipaste_2019-09-21_15-29-21.png](https://camo.githubusercontent.com/2740188d046cfb6c94d1262e3045ac8e6fa40c1b0a6e86313e45b5ec712282e2/687474703a2f2f7777312e73696e61696d672e636e2f6c617267652f303036374f515658677931673737367371773778336a3330666f3037313074672e6a7067)
- LoginServlet拦截/login.do请求,取得参数,判定是否和指定值相等,相等就将用户名存入session,然后重定向到index.jsp主页
- 主页通过jsp表达式<%= %>,用session内置对象取出用户名显示
![Snipaste_2019-09-21_15-29-33.png](https://camo.githubusercontent.com/76cbdc0671933d5a35fea4bc7841381e9039201447c53c5d0186750031d9bd4e/687474703a2f2f7777312e73696e61696d672e636e2f6c617267652f303036374f5156586779316737373674366f72647a6a33306535303572337a332e6a7067)
- Student实体类,封装基础属性
- StudentServlet,拦截/students请求,创建一个集合存入若干Student对象,存入request,并通过服务器转发(地址栏不变)将request带到student.jsp页面
- student.jsp页面用request内置对象取出数据,并借助页面内置对象和EL表达式,遍历数据集合,在页面上显示
![学生信息显示.jpg](https://camo.githubusercontent.com/3714de141a3fd63ce4c8b52eba07090eaba2aea7da08d6ab9b3f46734d4b8c68/687474703a2f2f7777312e73696e61696d672e636e2f6c617267652f303036374f515658677931673737367130647537716a33316775306c6a3430742e6a7067)
web-dev-quickstart's People
Contributors
Watchers