diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/artifacts/TomcatDemo_war_exploded.xml b/.idea/artifacts/TomcatDemo_war_exploded.xml new file mode 100644 index 0000000..1f8adbd --- /dev/null +++ b/.idea/artifacts/TomcatDemo_war_exploded.xml @@ -0,0 +1,13 @@ + + + $PROJECT_DIR$/out/artifacts/TomcatDemo_war_exploded + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..c2bae49 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/libraries/gson_2_8_5.xml b/.idea/libraries/gson_2_8_5.xml new file mode 100644 index 0000000..95040b6 --- /dev/null +++ b/.idea/libraries/gson_2_8_5.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..e0844bc --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..35c036f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/_JAVAWEB.iml b/_JAVAWEB.iml new file mode 100644 index 0000000..de3fafb --- /dev/null +++ b/_JAVAWEB.iml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/out/artifacts/TomcatDemo_war_exploded/WEB-INF/web.xml b/out/artifacts/TomcatDemo_war_exploded/WEB-INF/web.xml new file mode 100644 index 0000000..cbd3f16 --- /dev/null +++ b/out/artifacts/TomcatDemo_war_exploded/WEB-INF/web.xml @@ -0,0 +1,256 @@ + + + + + + + + age + 18 + + + HelloServlet + Servlet.HelloServlet + + encode + UTF-8 + + + + HelloServlet + /HelloServlet + + + + MyServlet + Servlet.MyServlet + + encode + UTF-8 + + + + MyServlet + /MyServlet + + + + LoginServlet + Servlet.LoginServlet + + encode + UTF-8 + + + + LoginServlet + /LoginServlet + + + + RegistServlet + Servlet.RegistServlet + + encode + UTF-8 + + + + RegistServlet + /RegistServlet + + + + CreateCookieServlet + Servlet.CreateCookieServlet + + encode + UTF-8 + + + + CreateCookieServlet + /CreateCookieServlet + + + + + GetCookieServlet + Servlet.GetCookieServlet + + encode + UTF-8 + + + + GetCookieServlet + /GetCookieServlet + + + + UpdateCookieServlet + Servlet.UpdateCookieServlet + + encode + UTF-8 + + + + UpdateCookieServlet + /UpdateCookieServlet + + + + KeepCookieServlet + Servlet.KeepCookieServlet + + encode + UTF-8 + + + + KeepCookieServlet + /KeepCookieServlet + + + + UserCookieServlet + Servlet.UserCookieServlet + + encode + UTF-8 + + + + UserCookieServlet + /UserCookieServlet + + + + GetSessionServlet + Servlet.GetSessionServlet + + encode + UTF-8 + + + + GetSessionServlet + /GetSessionServlet + + + + KeepSessionServlet + Servlet.KeepSessionServlet + + encode + UTF-8 + + + + KeepSessionServlet + /KeepSessionServlet + + + + RemoveSessionServlet + Servlet.RemoveSessionServlet + + encode + UTF-8 + + + + RemoveSessionServlet + /RemoveSessionServlet + + + + FormRepeatServlet + Servlet.FormRepeatServlet + + encode + UTF-8 + + + + FormRepeatServlet + /FormRepeatServlet + + + + + HelloWorldFilter + Filter.HelloWorldFilter + + + HelloWorldFilter + + /userServlet + + + + userServlet + Filter.userServlet + + + userServlet + /userServlet + + + + userServletFilter + Filter.userServletFilter + + + userServletFilter + /userServlet + + + + + + + + HttpFilterTest + Filter.HttpFilterTest + + + HttpFilterTest + + /HttpFilterTest + + + + + + + + + + + + + + + + + + AjaxServlet + Ajax.AjaxServlet + + encode + UTF-8 + + + + AjaxServlet + /AjaxServlet + + \ No newline at end of file diff --git a/out/artifacts/TomcatDemo_war_exploded/index.jsp b/out/artifacts/TomcatDemo_war_exploded/index.jsp new file mode 100644 index 0000000..f14fda0 --- /dev/null +++ b/out/artifacts/TomcatDemo_war_exploded/index.jsp @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/6/24 + Time: 17:18 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + $Title$ + + + hello + + diff --git a/src/Ajax/AjaxServlet.java b/src/Ajax/AjaxServlet.java new file mode 100644 index 0000000..6c8f59d --- /dev/null +++ b/src/Ajax/AjaxServlet.java @@ -0,0 +1,31 @@ +package Ajax; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; + +@WebServlet(name = "AjaxServlet") +public class AjaxServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + System.out.println("doPost()"); + String name = request.getParameter("name"); + String location = request.getParameter("location"); + System.out.println("name:"+name+" location:"+location); + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + System.out.println("doGet()"); + String name = request.getParameter("name"); + String age = request.getParameter("age"); + System.out.println(name); + System.out.println(age); + PrintWriter writer = response.getWriter(); + //writer.write("success!!!"); + //如果dataType:"json",则返回一定要是json格式,否则会报错 + writer.write("{\"msg\":\"success\"}"); + } +} diff --git a/src/CSS/lesson01/index.html b/src/CSS/lesson01/index.html deleted file mode 100644 index b7346ac..0000000 --- a/src/CSS/lesson01/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Title - - - - -

我是标题

- - \ No newline at end of file diff --git a/src/CSS/lesson01/style.css b/src/CSS/lesson01/style.css deleted file mode 100644 index 414dfeb..0000000 --- a/src/CSS/lesson01/style.css +++ /dev/null @@ -1,4 +0,0 @@ - - h1{ - color:red; - } \ No newline at end of file diff --git a/src/CSS/lesson02/index.html b/src/CSS/lesson02/index.html deleted file mode 100644 index 3741cb7..0000000 --- a/src/CSS/lesson02/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Title - - - - -

我的标题

- - \ No newline at end of file diff --git "a/src/CSS/lesson04/1.\345\261\202\346\254\241\351\200\211\346\213\251\345\231\250.html" "b/src/CSS/lesson04/1.\345\261\202\346\254\241\351\200\211\346\213\251\345\231\250.html" deleted file mode 100644 index ae44fac..0000000 --- "a/src/CSS/lesson04/1.\345\261\202\346\254\241\351\200\211\346\213\251\345\231\250.html" +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Title - - - -

p0

-

p1

-

p2

-

p3

- -

p7

-

p8

- - \ No newline at end of file diff --git "a/src/CSS/lesson04/2.\347\273\223\346\236\204\344\274\252\347\261\273\351\200\211\346\213\251\345\231\250.html" "b/src/CSS/lesson04/2.\347\273\223\346\236\204\344\274\252\347\261\273\351\200\211\346\213\251\345\231\250.html" deleted file mode 100644 index b8977f5..0000000 --- "a/src/CSS/lesson04/2.\347\273\223\346\236\204\344\274\252\347\261\273\351\200\211\346\213\251\345\231\250.html" +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Title - - - - -333 -

p1

-

p2

-

p3

- - - \ No newline at end of file diff --git "a/src/CSS/lesson04/3.\345\261\236\346\200\247\351\200\211\346\213\251\345\231\250.html" "b/src/CSS/lesson04/3.\345\261\236\346\200\247\351\200\211\346\213\251\345\231\250.html" deleted file mode 100644 index aeaa4f4..0000000 --- "a/src/CSS/lesson04/3.\345\261\236\346\200\247\351\200\211\346\213\251\345\231\250.html" +++ /dev/null @@ -1,59 +0,0 @@ - - - - - Title - - - -

- 1 - 2 - 3 - 4 - 5 - 6 -

- - \ No newline at end of file diff --git "a/src/CSS/lesson05/1.span\346\240\207\347\255\276.html" "b/src/CSS/lesson05/1.span\346\240\207\347\255\276.html" deleted file mode 100644 index 1a845e3..0000000 --- "a/src/CSS/lesson05/1.span\346\240\207\347\255\276.html" +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Title - - - -欢迎学习 css - - \ No newline at end of file diff --git "a/src/CSS/lesson05/2.\345\255\227\344\275\223\346\240\267\345\274\217.html" "b/src/CSS/lesson05/2.\345\255\227\344\275\223\346\240\267\345\274\217.html" deleted file mode 100644 index 0488bfb..0000000 --- "a/src/CSS/lesson05/2.\345\255\227\344\275\223\346\240\267\345\274\217.html" +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Title - - - - -

故事介绍

-

小说主要描绘了一个名叫斗罗大陆的武魂世界。唐门外门弟子唐三,因偷学内门绝学而为唐门所不容, - 跳崖明志时却发现穿越到另一个世界,即斗罗大陆的圣魂村。这里没有魔法,没有武术,没有战斗力,

-

- 却有神奇的武魂。这里的每个人在6岁的时候,都会在武魂殿中在魂师的帮助下进行武魂觉醒。武魂有动物,有植物,有器物

-

武魂可以辅助人们的曰常生活,有特殊天赋的人可以用之修炼并进行战斗。

- -

- He was my North, my South, my East and West, My working week and my Sunday rest, - My noon, my midnight, my talk, my song; - I thought that love would last forever: I was wrong.” -

- - \ No newline at end of file diff --git "a/src/CSS/lesson05/2.\345\255\227\344\275\223\346\240\267\345\274\2172.html" "b/src/CSS/lesson05/2.\345\255\227\344\275\223\346\240\267\345\274\2172.html" deleted file mode 100644 index 1906fed..0000000 --- "a/src/CSS/lesson05/2.\345\255\227\344\275\223\346\240\267\345\274\2172.html" +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Title - - - - -

- 却有神奇的武魂。这里的每个人在6岁的时候,都会在武魂殿中在魂师的帮助下进行武魂觉醒。武魂有动物,有植物,有器物

-

武魂可以辅助人们的曰常生活,有特殊天赋的人可以用之修炼并进行战斗。

- - - \ No newline at end of file diff --git "a/src/CSS/lesson05/3.\346\226\207\346\234\254\346\240\267\345\274\217.html" "b/src/CSS/lesson05/3.\346\226\207\346\234\254\346\240\267\345\274\217.html" deleted file mode 100644 index e1b9ffb..0000000 --- "a/src/CSS/lesson05/3.\346\226\207\346\234\254\346\240\267\345\274\217.html" +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Title - - - - -

3333

-

2222

-

1111

-

故事介绍

-

小说主要描绘了一个名叫斗罗大陆的武魂世界。唐门外门弟子唐三,因偷学内门绝学而为唐门所不容, - 跳崖明志时却发现穿越到另一个世界,即斗罗大陆的圣魂村。这里没有魔法,没有武术,没有战斗力,

-

- 却有神奇的武魂。这里的每个人在6岁的时候,都会在武魂殿中在魂师的帮助下进行武魂觉醒。武魂有动物,有植物,有器物

-

武魂可以辅助人们的曰常生活,有特殊天赋的人可以用之修炼并进行战斗。

- - \ No newline at end of file diff --git "a/src/CSS/lesson05/3.\346\226\207\346\234\254\346\240\267\345\274\2172.html" "b/src/CSS/lesson05/3.\346\226\207\346\234\254\346\240\267\345\274\2172.html" deleted file mode 100644 index 69034c5..0000000 --- "a/src/CSS/lesson05/3.\346\226\207\346\234\254\346\240\267\345\274\2172.html" +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Title - - - - -

- asasassa -

- - \ No newline at end of file diff --git "a/src/CSS/lesson06/1.\350\266\205\351\223\276\346\216\245\344\274\252\347\261\273.html" "b/src/CSS/lesson06/1.\350\266\205\351\223\276\346\216\245\344\274\252\347\261\273.html" deleted file mode 100644 index 0bf1615..0000000 --- "a/src/CSS/lesson06/1.\350\266\205\351\223\276\346\216\245\344\274\252\347\261\273.html" +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Title - - - - - 你当像鸟飞往你的山 - -

- 你当像鸟飞往你的山 -

-

- 作者:塔拉·韦斯特弗 -

-

- ¥59 -

- - \ No newline at end of file diff --git "a/src/CSS/lesson06/2.\345\210\227\350\241\250\346\240\267\345\274\217\347\273\203\344\271\240.html" "b/src/CSS/lesson06/2.\345\210\227\350\241\250\346\240\267\345\274\217\347\273\203\344\271\240.html" deleted file mode 100644 index 1f090a8..0000000 --- "a/src/CSS/lesson06/2.\345\210\227\350\241\250\346\240\267\345\274\217\347\273\203\344\271\240.html" +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Title - - - - - - \ No newline at end of file diff --git a/src/CSS/lesson06/goods.css b/src/CSS/lesson06/goods.css deleted file mode 100644 index 1a99de6..0000000 --- a/src/CSS/lesson06/goods.css +++ /dev/null @@ -1,36 +0,0 @@ -.title{ - font-size: 18px; - font-weight: bold; - tab-index: 1em; - line-height: 30px; - background: red; -} -/* -list-style: -none 去掉圆点 -circle 空心圆 -decimal 数字 -square 正方形 -*/ -#nav{ - width: 270px; -} -ul{ - background: #61646b; -} -ul li{ - height: 30px; - list-style: none; - tab-index: 1em; - /* background-image: url("11.jpg"); - background-repeat: no-repeat; - background-position: 150px 20px;*/ -} -a{ - text-decoration: none; - color: black; -} -a:hover{ - color: cadetblue; - text-decoration: underline; -} \ No newline at end of file diff --git "a/src/CSS/lesson07/\346\270\220\345\217\230.html" "b/src/CSS/lesson07/\346\270\220\345\217\230.html" deleted file mode 100644 index 654fb6c..0000000 --- "a/src/CSS/lesson07/\346\270\220\345\217\230.html" +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Title - - - - - - - \ No newline at end of file diff --git "a/src/CSS/lesson07/\350\203\214\346\231\257.html" "b/src/CSS/lesson07/\350\203\214\346\231\257.html" deleted file mode 100644 index c212f62..0000000 --- "a/src/CSS/lesson07/\350\203\214\346\231\257.html" +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Title - - - -
-
-
- -ml> \ No newline at end of file diff --git a/src/CSS/lesson09/display.html b/src/CSS/lesson09/display.html deleted file mode 100644 index 63ae7bd..0000000 --- a/src/CSS/lesson09/display.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Title - - - - -
div块元素
-span行内元素 - - \ No newline at end of file diff --git "a/src/CSS/lesson09/\346\265\256\345\212\250.html" "b/src/CSS/lesson09/\346\265\256\345\212\250.html" deleted file mode 100644 index 3829f14..0000000 --- "a/src/CSS/lesson09/\346\265\256\345\212\250.html" +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Title - - - - - - - \ No newline at end of file diff --git "a/src/CSS/lesson10/1\351\273\230\350\256\244\346\203\205\345\206\265.html" "b/src/CSS/lesson10/1\351\273\230\350\256\244\346\203\205\345\206\265.html" deleted file mode 100644 index 8b53b19..0000000 --- "a/src/CSS/lesson10/1\351\273\230\350\256\244\346\203\205\345\206\265.html" +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Title - - - -
-
第一个盒子
-
第二个盒子
-
第三个盒子
-
- - \ No newline at end of file diff --git "a/src/CSS/lesson10/2\347\233\270\345\257\271\345\256\232\344\275\215.html" "b/src/CSS/lesson10/2\347\233\270\345\257\271\345\256\232\344\275\215.html" deleted file mode 100644 index 9de1ef4..0000000 --- "a/src/CSS/lesson10/2\347\233\270\345\257\271\345\256\232\344\275\215.html" +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Title - - - - -
-
第一个盒子
-
第二个盒子
-
第三个盒子
-
- - \ No newline at end of file diff --git "a/src/CSS/lesson10/3\347\273\203\344\271\240_\346\226\271\345\235\227\345\256\232\344\275\215.html" "b/src/CSS/lesson10/3\347\273\203\344\271\240_\346\226\271\345\235\227\345\256\232\344\275\215.html" deleted file mode 100644 index 01842fd..0000000 --- "a/src/CSS/lesson10/3\347\273\203\344\271\240_\346\226\271\345\235\227\345\256\232\344\275\215.html" +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Title - - - -
- 链接1 - 链接2 - 链接3 - 链接4 - 链接5 -
- - \ No newline at end of file diff --git "a/src/CSS/lesson10/4\347\273\235\345\257\271\345\256\232\344\275\215.html" "b/src/CSS/lesson10/4\347\273\235\345\257\271\345\256\232\344\275\215.html" deleted file mode 100644 index a167230..0000000 --- "a/src/CSS/lesson10/4\347\273\235\345\257\271\345\256\232\344\275\215.html" +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Title - - - - -
-
第一个盒子
-
第二个盒子
-
第三个盒子
-
- - \ No newline at end of file diff --git "a/src/CSS/lesson10/5\345\233\272\345\256\232\345\256\232\344\275\215.html" "b/src/CSS/lesson10/5\345\233\272\345\256\232\345\256\232\344\275\215.html" deleted file mode 100644 index 70ca824..0000000 --- "a/src/CSS/lesson10/5\345\233\272\345\256\232\345\256\232\344\275\215.html" +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Title - - - - -
div1
-
div2
- - \ No newline at end of file diff --git a/src/CSS/lesson10/6z-index.html b/src/CSS/lesson10/6z-index.html deleted file mode 100644 index 6488078..0000000 --- a/src/CSS/lesson10/6z-index.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Title - - - - -
- -
- - \ No newline at end of file diff --git "a/src/CSS/lesson3/1.\346\240\207\347\255\276\351\200\211\346\213\251\345\231\250.html" "b/src/CSS/lesson3/1.\346\240\207\347\255\276\351\200\211\346\213\251\345\231\250.html" deleted file mode 100644 index 41aae4a..0000000 --- "a/src/CSS/lesson3/1.\346\240\207\347\255\276\351\200\211\346\213\251\345\231\250.html" +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Title - - - -

学java

-

开学前学完前端

-

好好学习

- - \ No newline at end of file diff --git "a/src/CSS/lesson3/2.\347\261\273\351\200\211\346\213\251\345\231\250.html" "b/src/CSS/lesson3/2.\347\261\273\351\200\211\346\213\251\345\231\250.html" deleted file mode 100644 index 0f2b850..0000000 --- "a/src/CSS/lesson3/2.\347\261\273\351\200\211\346\213\251\345\231\250.html" +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Title - - - -

标题1

-

标题2

-

标题3

-

我爱java

- - \ No newline at end of file diff --git "a/src/CSS/lesson8/\345\234\206\345\275\242.html" "b/src/CSS/lesson8/\345\234\206\345\275\242.html" deleted file mode 100644 index b68f749..0000000 --- "a/src/CSS/lesson8/\345\234\206\345\275\242.html" +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Title - - - - - -
- - - \ No newline at end of file diff --git "a/src/CSS/lesson8/\345\234\206\350\247\222\350\276\271\346\241\206.html" "b/src/CSS/lesson8/\345\234\206\350\247\222\350\276\271\346\241\206.html" deleted file mode 100644 index ef2645d..0000000 --- "a/src/CSS/lesson8/\345\234\206\350\247\222\350\276\271\346\241\206.html" +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Title - - - - - -
- - \ No newline at end of file diff --git "a/src/CSS/lesson8/\347\233\222\345\255\220\346\250\241\345\236\213.html" "b/src/CSS/lesson8/\347\233\222\345\255\220\346\250\241\345\236\213.html" deleted file mode 100644 index 79cbe31..0000000 --- "a/src/CSS/lesson8/\347\233\222\345\255\220\346\250\241\345\236\213.html" +++ /dev/null @@ -1,51 +0,0 @@ - - - - - Title - - - -
-

会员登录

-
-
- 用户名: - -
-
- 密码: - -
-
- 邮箱: - -
-
-
- - - - - - Title - - - - -
-

会员登录

-
-
- 用户名: - -
-
- 密码: - -
-
- 邮箱: - -
-
-
- - - - - - Title - - - - - \ No newline at end of file diff --git a/src/Demo/AjaxDemo.java b/src/Demo/AjaxDemo.java new file mode 100644 index 0000000..557955e --- /dev/null +++ b/src/Demo/AjaxDemo.java @@ -0,0 +1,40 @@ +package Demo; + +/** + * @author lifei + * @date 2020/7/1 8:50 + */ +public class AjaxDemo { + /* + *Ajax + *简介 + *Asynchronous JavaScript And Xml,直译为异步的JS和XML + * Ajax也可以简单的理解为通过JS向服务器发送请求 + * 实际意义:不发生页面跳转,异步载入内容并改写页面内容的技术 + *异步请求&同步请求 + *同步解决问题: + *1.请求:发送二次请求时,只能等上次请求响应后,才能执行 + *2.效率:就算我们需要刷新局部,也必须刷新整个页面 + *异步解决问题: + *1.请求:Ajax请求不会影响其他请求 + *2.效率:局部刷新 + *使用 + js->ajax + jQuery->ajax(常用) + *语法 + $.ajax({ + type: "POST","请求方式:get|post", + url: "../AjaxServlet","请求路径" + data: "name=John&location=Boston",“参数” + dataType:预期服务器返回的数据类型,如xml|json|text + success:function(回调函数,请求成功时回调) + // PrintWriter writer = response.getWriter(); + // writer.write("success!!!");回调函数的参数时success!!! + error:function(回调函数:请求失败时回调) + (还有另外三个回调函数) + }); + * Ajax简写 + *$.post/get(url,[data],[callback],[dataType]) + * *$.getJson(url,[data],[callback]) + */ +} diff --git a/src/Demo/CookieDemo.java b/src/Demo/CookieDemo.java new file mode 100644 index 0000000..5a778ce --- /dev/null +++ b/src/Demo/CookieDemo.java @@ -0,0 +1,60 @@ +package Demo; + +/** + * @author lifei + * @date 2020/6/28 8:02 + */ +public class CookieDemo { + /* + Cookie + *简介:实际上就是服务器保存在浏览器上的一段信息,主要用于区分不同的用户 + *运行原理: + *请求 + *服务器创建一个Cookie对象,该Cookie对象携带用户信息,服务器发送(响应)给客户端 + *以后客户端再发送请求时,会携带Cookie对象 + *服务器会根据该Cookie对象(及信息),区分不同用户 + *Cookie创建&获取&修改 + *创建 + //创建Cookie对象并携带信息 + Cookie cookieName=new Cookie("stuName","aa"); + //响应给客户端 + response.addCookie(cookieName); + *获取 + Cookie[] cookies = request.getCookies(); + cookie.getName()|cookie.getValue() + *修改 + *覆盖式修改 + Cookie cookieName=new Cookie("stuName","bb"); + response.addCookie(cookieName); + *直接式修改 + Cookie[]cookies=request.getCookies(); + for (Cookie cookie:cookies){ + if("stuName".equals(cookie.getName())){ + cookie.setValue("cc"); + response.addCookie(cookie); + break; + } + } + *Cookie的键值问题 + *name不可以为中文,value可以为中文,但需要指定字符集问题 + *Cookie有效性 + *默认为会话级别(关闭浏览器和换浏览器后失效) + *持久化: + *setMaxAge(ss:秒) + ss>0:ss秒后失效 + ss=0:立即失效 + ss<0:默认会话级别 + *持久化Cookie,该Cookie不是会话级别 + *Cookie有效路径 + *默认有效路径:当前项目路径 + *设置有效路径:一般设置有效路径,都是基于当前项目下的路径进行设置 + 如:cookie.setPath(request.getContextPath()+"/a"); + *Cookie应用 + *记住密码 UserCookieServlet login2.html + *Cookie缺陷 + *Cookie的value为String类型,不灵活 + *Cookie存放在浏览器中,不安全。 + *Cookie过多会浪费流量。 + + */ +} diff --git a/src/Demo/Demo.java b/src/Demo/Demo.java new file mode 100644 index 0000000..a164d25 --- /dev/null +++ b/src/Demo/Demo.java @@ -0,0 +1,77 @@ +package Demo; + +/** + * @author lifei + * @date 2020/6/26 9:24 + */ +public class Demo { + /* + 1:请求和响应 + 请求:客户端向服务器 + 类型;HttpServletRequest request + 定义:代表了客户端向服务器发送的请求报文,该对象由服务器(web容器|Servlet容器)创建 + 发送给Service()->doGet()或doPost() + 作用:1.获取请求参数 + request.getParameter("username") + request.getParameterValues(name) + 2.获取项目虚拟路径 + request.getContextPath() + 3.转发(路径跳转) + //1.获取转发器 + request.getRequestDispatcher("HTML/login_success.html"); + //2,执行转发 + requestDispatcher.forward(request,response); + 4.域对象(4个) + 响应:服务器向客户端 + 类型:HttpServletResponse response + 定义:代表了服务器向客户端发送的响应报文,该对象由服务器(web容器|Servlet容器)创建 + 发送给Service()->doGet()或doPost() + 作用:1.服务器向客户端做出响应(文本|html) + //获取响应流 + PrintWriter writer = response.getWriter(); + //响应 + writer.write("login success!"); + writer.write("

login success!

"); + 2.重定向(路径跳转) + response.sendRedirect("HTML/login_success.html"); + 2:转发与重定向区别 + 转发地址栏不变,重定向地址栏改变 + 转发客户端发送一次请求,重定向客户端发送两次请求 + 转发可以访问web-inf下资源,重定向不能 + 因为web-inf目录属于web应用的私有目录(客户端无法直接访问) + 转发可以携带request对象,重定向不能 + 3:Servlet练习(伪登录/伪注册) + 4:web项目应用路径问题 + 在web应用中,由于使用转发跳转路径时,地址栏不变,此时使用相对路径(../)存在404现象 + 因此使用绝对路径解决web应用中的路径问题 + 绝对路径,一”/“开头的是绝对路径 + “/”代表:由服务器解析,代表当前项目路径 http://localhost:8081/TomcatDemo_war_exploded + 情况1:web.xml中的url + 情况2:转发 直接在前面加/ + 由浏览器解析,代表当前服务器路径 http://localhost:8081 + 情况1:html中路径 eg:src script|img href:link|a action:form + 情况2:重定向 在前面+request.getContextPath()+"..." + 5:web应用乱码问题 + 乱码:编码与解码不一致时,出现乱码现象 + 编码:将字符转化成二进制的过程称之为编码 + 解码:将二进制转化为字符的过程称之为解码 + *请求乱码:客户端编码与服务器解码不一致 + *响应乱码:服务器编码与客户端解码不一致 + 默认客户端与服务器端的编码与解码情况 + *服务器的编码和解码默认一致:ISO-8859-1(不支持中文) + *客户端(浏览器)编码默认为: + 解码默认为:GBK + 解决web中乱码问题 + *请求乱码 + post:request.setCharacterEncoding("UTF-8"); + get:在server.xml中修改 + HelloWorldFilter + Filter.HelloWorldFilter + + + HelloWorldFilter + /userServlet//url为要过滤的地址 + + * HelloWorld + * Filter的生命周期 + *构造器 + *执行次数:执行一次 + *执行时机:启动服务器时执行 + * init() + *执行次数:执行一次 + *执行时机:启动服务器时执行 + * doFilter() + *执行次数:执行多次 + *执行时机:每次过滤请求时执行 + * destroy() + *执行次数:执行一次 + *执行时机:关闭服务器时执行 + * Filter的工作原理 + *请求:服务器->filter->web资源 响应:web资源->filter->服务器 + 具体过程 + * 请求 + * 执行过滤器中的doFilter(),执行放行前的代码 + * 放行请求,执行处理请求代码(Servlet) + * 执行过滤器中的doFilter(),执行放行后的代码 + * 响应 + * 多个Filter的执行流程 + *请求 + * Filter1放行前 + * Filter2放行前 + * 处理请求,做出响应 + * Filter2放行后 + * Filter1放行后 + 注意:Filter的先后顺序是在web.xml中url-pattern的先后顺序决定 + * Url的配置规则 + 1.精准配置 + * /userServlet + * userServlet(将url换成name) + 2.模糊配置,包含“*”的配置,称之为模糊配置 + *前置模糊 *.jsp 过滤当前项目下所有的jsp + *后置模糊 "/Cookie/*" 过滤Cookie下的所有项目 + * HttpFilter + *HttpServlet->GenericServlet->Servlet + *HttpFilter + *getXXX() + *abstract doFilter() + *overload doFilter() + */ + + + +} diff --git a/src/Demo/JSPDemo.java b/src/Demo/JSPDemo.java new file mode 100644 index 0000000..6e015ab --- /dev/null +++ b/src/Demo/JSPDemo.java @@ -0,0 +1,124 @@ +package Demo; + +/** + * @author lifei + * @date 2020/6/27 10:06 + */ +public class JSPDemo { + /* + JSP:java服务端页面 + Servlet=java+html + Jsp=html+java + JSP只能运行服务器(Web容器)中 + 其本质是Servlet + *JSP运行原理 + *第一次访问JSP文件时会经过以下步骤 + *服务器将.jsp文件翻译成.java文件 + *将.java文件编译为.class文件 + *运行 + *文件未改变时,以后再访问,不会翻译和编译 + *JSP基本语法 + *指令 + *语法:<%@ %> + *脚本片段 + *<%%> + *作用:书写java代码。(写在_jspService()中) + <% + for(int i=0;i<=100;i+=2){ + %> + *表达式 + *语法:<%= %> + *作用:输出数据到页面 + *模板元素(html) + *声明 + *语法:<%!%> + *作用:书写java代码。(类中) + <%!int i=1;%> + *注释: + *html + java:// + jsp:<%-- --%> + *JSP指令 + *语法:<%@ 指令名 属性名1=属性值1 属性名2=属性值2%> + *常用指令 + *page指令 + language:支持语言,只有java + contentType:设置服务器属性 + import:导包 + errorPage:错误页面(当前页面出现错误显示的界面) + isErrorPage:设置当前页面是否为错误页面 + *include指令 + 作用:将目标页面包含到当前页面中 + 特点:静态包含,被包含的文件不会被翻译和编译 + *JSP动作标签 + *语法: + *常用的动作标签 + *转发: + *带参数 + * + + + 此时hello.jsp界面可以通过<%=request.getParameter("age")%>得到18 + *不带参数 + * * + 注意开始标签和结束标签中间不能有任何内容包括空格 + *动态包含: + *语法: + *特点:被包含文件会先被翻页和编译 + *JSP九大隐藏对象 + 定义:可以在jsp中直接使用的对象(不需要我们new的对象,服务器实例化的九大隐含对象,并存放在Service()方法中) + *对象详情 + *application + *类型:ServletContent + *作用:域对象 + *Servlet中的获取方式:this.getServletContext() + *session + *类型:HttpSession + *作用:域对象 + *Servlet中的获取方式:request.getSession() + *request + *类型:HttpServletRequest + *作用:域对象 + *Servlet中的获取方式:直接使用 + *pageContext + *类型:PageContext + *作用:域对象 jspBoss(可以通过它获取其他8个隐含对象) + *Servlet中的获取方式:无 + *response + *类型:HttpServletResponse + *作用:域Servlet中的response对象一致 + *Servlet中的获取方式:直接使用 + *page + *类型:Object + *作用:page=this,当前类的对象。 + *Servlet中的获取方式:直接使用 + *out + *类型:JspWriter + *作用:与Servlet中的PrintWriter的作用类似(都继承了java.io.Writer) + *Servlet中的获取方式:无 + *config + *类型:ServletConfig + *作用:与Servlet中的ServletConfig的作用一致 + *Servlet中的获取方式:this.getServletConfig() + *exception + *类型:Throwable + *作用:接收处理异常信息 + *Servlet中的获取方式:无 + *JSP四大域对象 + *域:区域:在web应用的不同资源中相互传递数据 + 程序区域 + *域对象共有方法: + *getAttribute() + *setAttribute() + *removeAttribute() + *详情(按照区域大->小)objectDemo.jsp + *application + *范围:当前项目中有效 + *session + *当前会话(浏览器未关闭,未换)中 + *request + *当前请求中有效 + *pageContext + *只在当前页面中生效 + */ +} diff --git a/src/Demo/JsonDemo.java b/src/Demo/JsonDemo.java new file mode 100644 index 0000000..7b30d4d --- /dev/null +++ b/src/Demo/JsonDemo.java @@ -0,0 +1,24 @@ +package Demo; + +/** + * @author lifei + * @date 2020/7/1 10:12 + */ +public class JsonDemo { + /* + Json + 简介:JavaScript Object Notation 的缩写,是JS提供的一种数据交换格式 + Json对象本质上就是一个JS对象,但是这个对象比较特殊,它可以直接转换为字符串 + 在不同的语言中进行传递,通过工具又可以转换为其他语言的对象 + *使用 + *Gson gson=new Gson() + *常用方法 + *toJson(Object o) + *fromJson(String jsonStr,Class) + *fromJson(String jsonStr,Type) + *Type获取方式 + *new TypeToken>(){}.getType{} + + */ + +} diff --git a/src/Demo/ListenerDemo.java b/src/Demo/ListenerDemo.java new file mode 100644 index 0000000..d4efa6c --- /dev/null +++ b/src/Demo/ListenerDemo.java @@ -0,0 +1,19 @@ +package Demo; + +/** + * @author lifei + * @date 2020/6/30 10:26 + */ +public class ListenerDemo { + /* + * Listener:监听器 + *监听对象:ServletContext,HttpSession,ServletRequest + *监听事件:对象创建,修改,删除等 + *监听结果:需求 + *监听者:程序员自己创建 + 注册: + * + Listener.ApplicationlistenerDemo + + */ +} diff --git a/src/Demo/ServletDemo.java b/src/Demo/ServletDemo.java new file mode 100644 index 0000000..6e86104 --- /dev/null +++ b/src/Demo/ServletDemo.java @@ -0,0 +1,67 @@ +package Demo; + +/** + * @author lifei + * @date 2020/6/25 10:27 + */ +public class ServletDemo { + /* + Servlet + Servlet=java+html(url) Servlet Applet(服务端小程序) + 狭义上javax.servlet.Servlet接口及其子类 + 广义上指实现了Servlet接口的实现类 + 使用Servlet接口的方式 + 创建一个类实现Servlet接口 + 在web.xml中注册这个实现类 + Tomcat(Servlet容器)会创建实现类对象 + Servlet工作原理(执行流程) + 请求 + web.xml中url + servlet-name + servlet-class,找到指定Servlet + 默认执行service(),处理请求,做出响应 + Servlet生命周期:从创建到消亡的过程 + 构造器 + 执行次数:在整个生命周期中执行一次 + 执行时机:第一次接收请求时执行 + init(): + 执行次数:在整个生命周期中执行一次 + 执行时机:第一次接收请求时执行 + service() + 执行次数:在整个生命周期中执行多次 + 执行时机:每次接收请求时执行 + destroy() + 执行次数:在整个生命周期中执行一次 + 执行时机:关闭服务器时执行 + ServletConfig和ServletContext区别 + ServletConfig:代表了Servlet的配置对象 + 作用: + 1:获取Servlet初始化参数 + 2:获取ServletConnect对象 + 3:获取Servlet名称 + ServletContext:代表了Servlet的上下文对象 + 作用: + 1:获取初始化参数 + 2:获取项目的真实路径 + 3:域对象 + 最终创建Servlet方式 + 继承HttpServlet类 + HttpServlet->GenericServlet->Servlet + + HttpServlet: + 1.override service(): + HttpServletRequest request=(HttpServletRequest)req; + HttpServletResponse response=(HttpServletResponse)res; + 2.overload service() + String method=request.getMethod(); + if(method.eq(”Get“){ + doGet(); + }else if(method.eq(“post”){ + doPost(); + } + GenericServlet: + 1:getServletConfig() getServletContext() + 2:abstract service() + + */ +} diff --git a/src/Demo/SessionDemo.java b/src/Demo/SessionDemo.java new file mode 100644 index 0000000..e0be67a --- /dev/null +++ b/src/Demo/SessionDemo.java @@ -0,0 +1,72 @@ +package Demo; + +import java.util.UUID; + +/** + * @author lifei + * @date 2020/6/28 10:22 + */ +public class SessionDemo { + /* + Session + *简介 + *类型:HttpSession + *工作原理 + *请求 + *服务器创建Session,同时创建一个特殊的Cookie,该Cookie的key为JSESSIONID + value为session的id + *服务器将该Cookie对象发送(响应)给客户端 + *以后客户端再请求时,会携带该Cookie对象 + 服务器会根据Cookie的value找到相应的Session,从而区分不同的用户 + *Session获取 + *html(Servlet):request.getSession() + *jsp:直接获取(session是jsp的隐含对象) + *Session有效性 + *默认有效性:当前会话(因为特殊的Cookie是会话级别) + *持久化Session: + *持久化特殊Cookie Cookie[] cookies = request.getCookies(); + for (Cookie c:cookies){ + if("JSESSIONID".equals(c.getName())){ + c.setMaxAge(60); + response.addCookie(c); + break; + } + } + *Session存活时间 + *默认为30min + *设置session的非活动时间(在tomcat的web.xml中设置) + + 30//分钟 + + *设置session的非活动时间(在doGet()方法中) + HttpSession session=request.getSession(); + session.setMaxInactiveInterval(ss);//秒数 + *ss>0:ss秒后失效 + *ss<=0:永不失效(Tomcat>=7有效) + *session立即失效: + HttpSession session = request.getSession(); + //设置session失效 + session.invalidate(); + *Session钝化与活化: + *钝化:将session对象及session对象中的数据一同从内存中序列化到硬盘的过程称之为钝化(对象要实现Serializable接口) + *时机:服务器关闭时触发 + *活化:将session对象及session对象中的数据,一同从硬盘反序列化到内存的过程称之为活化。 + *时机:服务器启时触发 + *Session应用 + *表单重复提交问题 + *转发,F5 解决:使用重定向 + *提交后,网速慢,连续点击提交按钮 点击后,用disable + *提交后,点击回退按钮,继续提交 + *提交-Servlet处理->响应 + *思路:在Servlet中干预提交,第一次提交,以后不提交 + 1.使用UUID,作为Token,将Token存放到session域中和隐藏域中 + *UUID是一个全球唯一的32位地16进制的随机数 + 2.提交,判断变量是否为初始值 + true:提交,移除session域中的Token(UUID) + false:不提交 + */ + public static void main(String[] args) { + String randomUUID=UUID.randomUUID().toString().replace("-",""); + System.out.println(randomUUID); + } +} diff --git a/src/Demo/Student.java b/src/Demo/Student.java new file mode 100644 index 0000000..8f060bd --- /dev/null +++ b/src/Demo/Student.java @@ -0,0 +1,43 @@ +package Demo; + +import java.io.Serializable; + +/** + * @author lifei + * @date 2020/6/29 10:58 + */ +public class Student implements Serializable {//实现序列化接口 + private String name; + private int age; + + public Student(String name, int age) { + this.name = name; + this.age = age; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + return "Student{" + + "name='" + name + '\'' + + ", age=" + age + + '}'; + } + + +} diff --git a/src/Demo/fileDemo.java b/src/Demo/fileDemo.java new file mode 100644 index 0000000..90f48a5 --- /dev/null +++ b/src/Demo/fileDemo.java @@ -0,0 +1,36 @@ +package Demo; + +/** + * @author lifei + * @date 2020/7/2 8:32 + */ +public class fileDemo { + /* + *文件上传&下载 + *上传 + 1.导入两个jar包 commons-fileupload-1.4.jar commons-io-2.7.jar + 2.form 属性一定为method="post" enctype="multipart/form-data"(get会丢失数据) + 而且文件的type一定为file + 3.步骤 具体看fileUploadServlet + *创建工厂类 DiskFileItemFactory + *创建解析器ServletFileUpload类 + *使用ServletFileUpload中的list parseRequest(request) + *FileItem中的write()方法,写到服务器 + 4.优化文件上传 + *使用UUID优化同名无法上传问题 + *设置上传文件的大小 upload.setFileSizeMax(2*1024); + *下载 具体看fileDownloadServlet + 1. //设置浏览器响应体文件类型 + String mimeType = request.getServletContext().getMimeType(fileName); + response.setContentType(mimeType) + 2. //解决文件名中文乱码问题 + String header=request.getHeader("User-Agent"); + if(header!=null&&header.contains("Firefox")){ + fileName="=?utf-8?B?"+ Base64.getEncoder().encode(fileName.getBytes("utf-8")); + }else{ + fileName= URLEncoder.encode(fileName,"UTF-8"); + } + 3. //设置浏览器响应内容格式为附件格式(告诉浏览器,是附件格式,下载) + response.setHeader("Content-Disposition","attachment;filename="+fileName); + */ +} diff --git a/src/Demo/httpDemo.java b/src/Demo/httpDemo.java new file mode 100644 index 0000000..b32b85d --- /dev/null +++ b/src/Demo/httpDemo.java @@ -0,0 +1,31 @@ +package Demo; + +/** + * @author lifei + * @date 2020/6/25 9:26 + */ +public class httpDemo { + /* + HTTP: + 超文本传输协议(无状态协议) + 报文:客户端与服务端通信时传输的内容我们称之为报文 + 请求报文(get请求和post请求,get请求的信息在url中,post在报文中,相等安全),响应报文 + 报文格式: + get请求: + 请求行:请求方式,请求地址,请求的http版本 + 请求头:携带的详细信息 + post请求: + 请求行 + 请求头 + 空行 + 请求体:请求数据 + 响应报文: + 响应行:响应http版本 响应码(200:请求成功 404:请求资源没找到 500:请求资源找到,但服务器内部错误 302:重新定向) + 响应头:详细信息 + 空行 + 响应体:响应数据信息 + HTTP协议的会话方式:建立连接->发送请求->服务器做出响应->关闭连接 + HTTP1.0(短连接,处理一个问题后关闭后再重来处理第二个)和HTTP1.1(长连接,一次性按顺序处理多个问题) + */ + +} diff --git a/src/File/fileDownloadServlet.java b/src/File/fileDownloadServlet.java new file mode 100644 index 0000000..2cd8db3 --- /dev/null +++ b/src/File/fileDownloadServlet.java @@ -0,0 +1,53 @@ +package File; + +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.FileInputStream; +import java.io.IOException; +import java.net.URLEncoder; +import java.util.Base64; + +@WebServlet(name = "fileDownloadServlet") +public class fileDownloadServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + request.setCharacterEncoding("UTF-8"); + //response.setContentType("text/html;charset=UTF-8"); + //获取文件名 + String fileName = request.getParameter("fileName"); + //获取该文件的真实路径 + String realPath = this.getServletContext().getRealPath("/File/download"); + String downPath=realPath+"/"+fileName; + System.out.println(downPath); + //设置浏览器响应体文件类型 + String mimeType = request.getServletContext().getMimeType(fileName); + response.setContentType(mimeType); + //解决文件名中文乱码问题 + String header=request.getHeader("User-Agent"); + if(header!=null&&header.contains("Firefox")){ + fileName="=?utf-8?B?"+ Base64.getEncoder().encode(fileName.getBytes("utf-8")); + }else{ + fileName= URLEncoder.encode(fileName,"UTF-8"); + } + //设置浏览器响应内容格式为附件格式(告诉浏览器,是附件格式,下载) + response.setHeader("Content-Disposition","attachment;filename="+fileName); + //读取目标资源,同时写到客户端(下载) + //创建读入流 + FileInputStream fis=new FileInputStream(downPath); + //创建读出流 + ServletOutputStream outputStream = response.getOutputStream(); + byte[]b=new byte[1024]; + while (fis.read(b)!=-1){ + outputStream.write(b); + } + fis.close(); + outputStream.close(); + } +} diff --git a/src/File/fileUploadServlet.java b/src/File/fileUploadServlet.java new file mode 100644 index 0000000..b90f61d --- /dev/null +++ b/src/File/fileUploadServlet.java @@ -0,0 +1,66 @@ +package File; + +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.FileUploadBase; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; +import org.apache.commons.fileupload.servlet.ServletFileUpload; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.UUID; + +@WebServlet(name = "fileUploadServlet") +public class fileUploadServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + request.setCharacterEncoding("UTF-8"); + /* + 1.创建工厂类 DiskFileItemFactory + 2.创建解析器ServletFileUpload类 + 3.使用ServletFileUpload中的list parseRequest(request) + 4.FileItem中的write()方法,写到服务器 + */ + //1.创建工厂类 DiskFileItemFactory + DiskFileItemFactory diskFileItemFactory=new DiskFileItemFactory(); + //2.创建解析器ServletFileUpload类 + ServletFileUpload upload = new ServletFileUpload(diskFileItemFactory); + //获取upload文件(要上传到的地方)的真实路径 + String realPath = this.getServletContext().getRealPath("/File/upload"); + //设置单个文件的上传大小 + upload.setFileSizeMax(2*1024); + //3.使用ServletFileUpload中的list parseRequest(request) + //迭代集合,查找指定的文件 + try { + List list=upload.parseRequest(request); + for (FileItem fileItem:list){ + if(fileItem.isFormField()==false){ + //4.FileItem中的write()方法,写到服务器 + String uuid = UUID.randomUUID().toString().replace("-", ""); + File file=new File(realPath+"/"+uuid+fileItem.getName()); + fileItem.write(file); + response.getWriter().write("upload success!!!"); + } + } + } catch (FileUploadBase.FileSizeLimitExceededException e) { + response.getWriter().write("文件不能超过2kb"); + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //获取参数 + String uname = request.getParameter("uname"); + String fileupload = request.getParameter("fileupload"); + System.out.println(uname); + System.out.println(fileupload); + } +} diff --git a/src/Filter/CharSetFilter.java b/src/Filter/CharSetFilter.java new file mode 100644 index 0000000..5f6ba56 --- /dev/null +++ b/src/Filter/CharSetFilter.java @@ -0,0 +1,22 @@ +package Filter; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * @author lifei + * @date 2020/6/30 10:05 + */ +public class CharSetFilter extends HttpFilter { + @Override + public void doFilter(HttpServletRequest servletRequest, HttpServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { + String code = this.getFilterConfig().getInitParameter("code"); + servletRequest.setCharacterEncoding(code); + servletResponse.setContentType("text/html;charset=UTF-8"); + //放行 + filterChain.doFilter(servletRequest,servletResponse); + } +} diff --git a/src/Filter/HelloWorldFilter.java b/src/Filter/HelloWorldFilter.java new file mode 100644 index 0000000..1ff6300 --- /dev/null +++ b/src/Filter/HelloWorldFilter.java @@ -0,0 +1,28 @@ +package Filter; + +import javax.servlet.*; +import java.io.IOException; + +/** + * @author lifei + * @date 2020/6/30 8:46 + */ +public class HelloWorldFilter implements Filter { + @Override + public void init(FilterConfig filterConfig) throws ServletException { + + } + + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { + System.out.println("HelloWorldFilter()放行前"); + //放行 + filterChain.doFilter(servletRequest,servletResponse); + System.out.println("HelloWorldFilter()放行后"); + } + + @Override + public void destroy() { + + } +} diff --git a/src/Filter/HttpFilter.java b/src/Filter/HttpFilter.java new file mode 100644 index 0000000..5e92c96 --- /dev/null +++ b/src/Filter/HttpFilter.java @@ -0,0 +1,39 @@ +package Filter; + +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * @author lifei + * @date 2020/6/30 9:42 + */ +public abstract class HttpFilter implements Filter { + private FilterConfig filterConfig; + @Override + public void init(FilterConfig filterConfig) throws ServletException { + this.filterConfig=filterConfig; + } + + /** + * 获取FilterConfig对象 + * @return + */ + public FilterConfig getFilterConfig() { + return filterConfig; + } + + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { + HttpServletRequest req=(HttpServletRequest) servletRequest; + HttpServletResponse res=(HttpServletResponse)servletResponse; + doFilter(req,res,filterChain); + } + public abstract void doFilter(HttpServletRequest servletRequest, HttpServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException; + + @Override + public void destroy() { + + } +} diff --git a/src/Filter/HttpFilterTest.java b/src/Filter/HttpFilterTest.java new file mode 100644 index 0000000..1e1170f --- /dev/null +++ b/src/Filter/HttpFilterTest.java @@ -0,0 +1,20 @@ +package Filter; + +import javax.servlet.*; +import javax.servlet.annotation.WebFilter; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebFilter(filterName = "HttpFilterTest") +public class HttpFilterTest extends HttpFilter { + + + @Override + public void doFilter(HttpServletRequest servletRequest, HttpServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { + FilterConfig filterConfig=this.getFilterConfig(); + System.out.println(filterConfig); + //放行 + filterChain.doFilter(servletRequest,servletResponse); + } +} diff --git a/src/Filter/userServlet.java b/src/Filter/userServlet.java new file mode 100644 index 0000000..61eff17 --- /dev/null +++ b/src/Filter/userServlet.java @@ -0,0 +1,19 @@ +package Filter; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name = "userServlet") +public class userServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + System.out.println("处理用户请求,做出响应"); + } +} diff --git a/src/Filter/userServletFilter.java b/src/Filter/userServletFilter.java new file mode 100644 index 0000000..277e04f --- /dev/null +++ b/src/Filter/userServletFilter.java @@ -0,0 +1,22 @@ +package Filter; + +import javax.servlet.*; +import javax.servlet.annotation.WebFilter; +import java.io.IOException; + +@WebFilter(filterName = "userServletFilter") +public class userServletFilter implements Filter { + public void destroy() { + } + + public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException { + System.out.println("userServletFilter()放行前"); + chain.doFilter(req, resp); + System.out.println("userServletFilter()放行后"); + } + + public void init(FilterConfig config) throws ServletException { + + } + +} diff --git a/src/HTML/1.html b/src/HTML/1.html deleted file mode 100644 index 00b9eb4..0000000 --- a/src/HTML/1.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - Title - - -

斗罗大陆

-

人物介绍

-

人物等级

-

人物关系

- - - - - - - - \ No newline at end of file diff --git a/src/HTML/10.html b/src/HTML/10.html deleted file mode 100644 index b0f8136..0000000 --- a/src/HTML/10.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - Title - - - - - - \ No newline at end of file diff --git a/src/HTML/11.html b/src/HTML/11.html deleted file mode 100644 index af2f405..0000000 --- a/src/HTML/11.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - Title - - - -

WWF 的目标是:构建人与自然和谐共存的世界。

- -

以下内容引用自 WWF 的网站:

-
- 五十年来,WWF 一直致力于保护自然界的未来。 - 世界领先的环保组织,WWF 工作于 100 个国家, - 并得到美国一百二十万会员及全球近五百万会员的支持。 -
- -

WHO 成立于 1948 年。

- -

WHO 成立于 1948 年。

- -

WHO 成立于 1948 年。

- -

WHO World Health Organization 成立于 1948 年。

- - -
- Written by Donald Duck.
- Visit us at:
- Example.com
- Box 564, Disneyland
- USA -
- -

The Scream by Edward Munch. Painted in 1893.

- -This text will be written from right to left - - \ No newline at end of file diff --git a/src/HTML/12.html b/src/HTML/12.html deleted file mode 100644 index 40c6842..0000000 --- a/src/HTML/12.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - Title - - - -

To open a file, select:

-

File | Open...

- - - demo.example.com login: Apr 12 09:10:17 - Linux 2.6.10-grsec+gg3+e+fhs6b+nfs+gr0501+++p3+c4a+gr2b-reslog-v6.189 - - -
- - var person = { firstName:"Bill", lastName:"Gates", age:50, eyeColor:"blue" } - - -

Coding Example:

- - -
-var person = {
-    firstName:"Bill",
-    lastName:"Gates",
-    age:50,
-    eyeColor:"blue"
-}
-
-
- -
-

Einstein wrote:

-

E = m c2

- - \ No newline at end of file diff --git a/src/HTML/13.html b/src/HTML/13.html deleted file mode 100644 index e62a17f..0000000 --- a/src/HTML/13.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Title - - - - -

这是一个段落。

- - - - - -(少写了个-) 标签会被包围在由 FrontPage 和 Expression Web 创建的 HTML 注释中。 -作为一项规则,这些标签的存在,有助于对创建这些标签的软件的支持。 ---> - - \ No newline at end of file diff --git a/src/HTML/14.html b/src/HTML/14.html deleted file mode 100644 index 920dbf3..0000000 --- a/src/HTML/14.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - Title - - - -

header 1

-

A paragraph.

- - - һӣ - - -

ͨⲿʽиʽ

-

Ҳһ

- - - \ No newline at end of file diff --git a/src/HTML/15.html b/src/HTML/15.html deleted file mode 100644 index fe4c002..0000000 --- a/src/HTML/15.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - Title - - - - -

我爱你

- - -

- This is a paragraph -

- - - \ No newline at end of file diff --git a/src/HTML/16.html b/src/HTML/16.html deleted file mode 100644 index 37bfca8..0000000 --- a/src/HTML/16.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - Title - - - -

本文本 是一个指向本网站中的一个页面的链接。

-

本文本 是一个指向万维网上的页面的链接。

- -

- 您也可以使用图像来作链接: - - - -

- - -Visit W3School - -Visit W3School! - - -基本的注意事项 - 有用的提示 - -有用的提示 - -有用的提示 - - - - \ No newline at end of file diff --git a/src/HTML/17.html b/src/HTML/17.html deleted file mode 100644 index d30278e..0000000 --- a/src/HTML/17.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - Title - - - -Visit W3School! -

如果把链接的 target 属性设置为 "_blank",该链接会在新窗口中打开。

- -

- 查看 Chapter 4。 -

-

Chapter 1

-

This chapter explains ba bla bla

-

Chapter 2

-

This chapter explains ba bla bla

-

Chapter 3

-

This chapter explains ba bla bla

-

Chapter 4

-

This chapter explains ba bla bla

-

Chapter 5

- -

被锁在框架中了吗?

-请点击这里! - -

- 这是邮件链接: - 发送邮件 -

-

- 注意:应该使用 %20 来替换单词之间的空格,这样浏览器就可以正确地显示文本了。 -

- -

- 这是另一个 mailto 链接: - 发送邮件! -

- -

- 注意:应该使用 %20 来替换单词之间的空格,这样浏览器就可以正确地显示文本了。 -

- - \ No newline at end of file diff --git a/src/HTML/18.html b/src/HTML/18.html deleted file mode 100644 index 4fa8c6d..0000000 --- a/src/HTML/18.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - Title - - - -

- 一幅图像: - -

-

- 一幅动画图像: - -

-

请注意,插入动画图像的语法与插入普通图像的语法没有区别。

- -

- 来自另一个文件夹的图像: - -

-

- 来自 W3School.com.cn 的图像: - -

- - - - - \ No newline at end of file diff --git a/src/HTML/19.html b/src/HTML/19.html deleted file mode 100644 index 166591a..0000000 --- a/src/HTML/19.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - Title - - - -

图像背景

-

gif 和 jpg 文件均可用作 HTML 背景。

-

如果图像小于页面,图像会进行重复。

- -

未设置对齐方式的图像:

-

图像 在文本中

-

已设置对齐方式的图像:

-

图像 在文本中

-

图像 在文本中

-

图像 在文本中

-

请注意,bottom 对齐方式是默认的对齐方式。

- -

- - 带有图像的一个段落。图像的 align 属性设置为 "left"。图像将浮动到文本的左侧。 -

-

- - 带有图像的一个段落。图像的 align 属性设置为 "right"。图像将浮动到文本的右侧。 -

- -

仅支持文本的浏览器无法显示图像,仅仅能够显示在图像的 "alt" 属性中指定的文本。在这里,"alt" 的文本是“向左转”。

-

请注意,如果您把鼠标指针移动到图像上,大多数浏览器会显示 "alt" 文本。

-向左转 -

如果无法显示图像,将显示 "alt" 属性中的文本:

-向左转 - -

- 您也可以把图像作为链接来使用: - - - -

- -

请点击图像上的星球,把它们放大。

-Planets - - - Venus - Mercury - Sun - -

注释:img 元素中的 "usemap" 属性引用 map 元素中的 "id" 或 "name" 属性(根据浏览器),所以我们同时向 map 元素添加了 "id" 和 "name" 属性。

- -

请把鼠标移动到图像上,看一下状态栏的坐标如何变化。

- - - - - - - \ No newline at end of file diff --git a/src/HTML/2.html b/src/HTML/2.html deleted file mode 100644 index 5e88462..0000000 --- a/src/HTML/2.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - Title - - - -

小舞成长史

> - -

少年时期的小舞

- -小舞介绍 - - - - \ No newline at end of file diff --git a/src/HTML/20.html b/src/HTML/20.html deleted file mode 100644 index 0e5e878..0000000 --- a/src/HTML/20.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - Title - - - -

每个表格由 table 标签开始。

-

每个表格行由 tr 标签开始。

-

每个表格数据由 td 标签开始。

-

一列:

- - - - -
100
-

一行三列:

- - - - - - -
100200300
-

两行三列:

- - - - - - - - - - - -
100200300
400500600
- -

带有普通的边框:

- - - - - - - - - -
FirstRow
SecondRow
-

带有粗的边框:

- - - - - - - - - -
FirstRow
SecondRow
-

带有很粗的边框:

- - - - - - - - - -
FirstRow
SecondRow
- - - - - - - - - - - - - - - - -
HeadingAnother Heading
row 1, cell 1row 1, cell 2
row 2, cell 1row 2, cell 2
- - - - - - - - - - -
row 1, cell 1row 1, cell 2
 row 2, cell 2
- -

表头:

- - - - - - - - - - - -
姓名电话电话
Bill Gates555 77 854555 77 855
-

垂直的表头:

- - - - - - - - - - - - - -
姓名Bill Gates
电话555 77 854
电话555 77 855
- -

这个表格有一个标题,以及粗边框:

- - - - - - - - - - - - -
我的标题
100200300
400500600
- - \ No newline at end of file diff --git a/src/HTML/21.html b/src/HTML/21.html deleted file mode 100644 index d67cfd8..0000000 --- a/src/HTML/21.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - Title - - - -

横跨两列的单元格:

- - - - - - - - - - - -
姓名电话
Bill Gates555 77 854555 77 855520 77 854
-

横跨两行的单元格:

- - - - - - - - - - - - -
姓名Bill Gates
电话555 77 854
555 77 855
- - - - - - - - - - -
-

这是一个段落。

-

这是另一个段落。

-
这个单元包含一个表格: - - - - - - - - - -
AB
CD
-
这个单元包含一个列表: -
    -
  • 苹果
  • -
  • 香蕉
  • -
  • 菠萝
  • -
-
HELLO
- -

没有 cellpadding:

- - - - - - - - - -
FirstRow
SecondRow
- -

带有 cellpadding:

- - - - - - - - - -
FirstRow
SecondRow
- -

没有 cellspacing:

- - - - - - - - - -
FirstRow
SecondRow
- -

带有 cellspacing:

- - - - - - - - - -
FirstRow
SecondRow
- -

背景颜色:

- - - - - - - - - -
FirstRow
SecondRow
- - -

单元背景:

- - - - - - - - - -
FirstRow
- SecondRow
-

单元背景:

- - - - - - - - - -
FirstRow
SecondRow
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
消费项目....一月二月
衣服$241.10$50.20
化妆品$30.00$44.45
食物$730.40$650.00
总计$1001.50$744.65
- -

注释:frame 属性无法在 Internet Explorer 中正确地显示。

- -

Table with frame="box":

- - - - - - - - - -
MonthSavings
January$100
- -

Table with frame="above":

- - - - - - - - - -
MonthSavings
January$100
- -

Table with frame="below":

- - - - - - - - - -
MonthSavings
January$100
- -

Table with frame="hsides":

- - - - - - - - - -
MonthSavings
January$100
- -

Table with frame="vsides":

- - - - - - - - - -
MonthSavings
January$100
- - - \ No newline at end of file diff --git a/src/HTML/22.html b/src/HTML/22.html deleted file mode 100644 index af05a76..0000000 --- a/src/HTML/22.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - Title - - - -

一个无序列表:

-
    -
  • 咖啡
  • -
  • -
  • 牛奶
  • -
- -
    -
  1. 咖啡
  2. -
  3. 牛奶
  4. -
  5. -
- -
    -
  1. 咖啡
  2. -
  3. 牛奶
  4. -
  5. -
- - - -
-
Coffee
-
Black hot drink
-
Milk
-
White cold drink
-
- -

Disc 项目符号列表:

-
    -
  • 苹果
  • -
  • 香蕉
  • -
- -

Circle 项目符号列表:

-
    -
  • 苹果
  • -
  • 香蕉
  • -
-

Square 项目符号列表:

-
    -
  • 苹果
  • -
  • 香蕉
  • -
- -

数字列表:

-
    -
  1. 苹果
  2. -
  3. 香蕉
  4. -
-

字母列表:

-
    -
  1. 苹果
  2. -
  3. 香蕉
  4. -
-

小写字母列表:

-
    -
  1. 苹果
  2. -
  3. 香蕉
  4. -
-

罗马字母列表:

-
    -
  1. 苹果
  2. -
  3. 香蕉
  4. -
-

小写罗马字母列表:

-
    -
  1. 苹果
  2. -
  3. 香蕉
  4. -
- -

一个嵌套列表:

-
    -
  • 咖啡
  • -
  • 茶 -
      -
    • 红茶
    • -
    • 绿茶
    • -
    -
  • -
  • 牛奶
  • -
- -

一个嵌套列表:

-
    -
  • 咖啡
  • -
  • 茶 -
      -
    • 红茶
    • -
    • 绿茶 -
        -
      • 中国茶
      • -
      • 非洲茶
      • -
      -
    • -
    -
  • -
  • 牛奶
  • -
- - - \ No newline at end of file diff --git a/src/HTML/23.html b/src/HTML/23.html deleted file mode 100644 index 902cc26..0000000 --- a/src/HTML/23.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - Title - - - - - - - - - \ No newline at end of file diff --git a/src/HTML/24.html b/src/HTML/24.html deleted file mode 100644 index 8ea2664..0000000 --- a/src/HTML/24.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - Title - - - -
-

London

-

- London is the capital city of England. - It is the most populous city in the United Kingdom, - with a metropolitan area of over 13 million inhabitants. -

-

- Standing on the River Thames, London has been a major settlement for two millennia, - its history going back to its founding by the Romans, who named it Londinium. -

-
- -
-

London

-

London is the capital city of England. - It is the most populous city in the United Kingdom, - with a metropolitan area of over 13 million inhabitants.

-
- -
-

Paris

-

Paris is the capital and most populous city of France.

-
- -
-

Tokyo

-

Tokyo is the capital of Japan, the center of the Greater Tokyo Area, - and the most populous metropolitan area in the world.

-
- -

My Important Heading

- - \ No newline at end of file diff --git a/src/HTML/25.html b/src/HTML/25.html deleted file mode 100644 index fdf150a..0000000 --- a/src/HTML/25.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - Title - - - - - - - -
-

London

-

- London is the capital city of England. It is the most populous city in the United Kingdom, - with a metropolitan area of over 13 million inhabitants. -

-

- Standing on the River Thames, London has been a major settlement for two millennia, - its history going back to its founding by the Romans, who named it Londinium. -

-
- - - - -
-

City Gallery

-
- - - -
-

London

-

- London is the capital city of England. It is the most populous city in the United Kingdom, - with a metropolitan area of over 13 million inhabitants. -

-

- Standing on the River Thames, London has been a major settlement for two millennia, - its history going back to its founding by the Romans, who named it Londinium. -

-
- -
- Copyright W3School.com.cn -
- - - - - - - -
- Note - - The table element was not designed to be a layout tool. -
- - - - - \ No newline at end of file diff --git a/src/HTML/26.html b/src/HTML/26.html deleted file mode 100644 index 5a97969..0000000 --- a/src/HTML/26.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - Title - - - - -

W3School Demo

-

Resize this responsive page!

-
- -
-

London

-

London is the capital city of England.

-

It is the most populous city in the United Kingdom, - with a metropolitan area of over 13 million inhabitants.

-
- -
-

Paris

-

Paris is the capital and most populous city of France.

-
- -
-

Tokyo

-

Tokyo is the capital of Japan, the center of the Greater Tokyo Area, - and the most populous metropolitan area in the world.

-
- - \ No newline at end of file diff --git a/src/HTML/27.html b/src/HTML/27.html deleted file mode 100644 index 45aecd8..0000000 --- a/src/HTML/27.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - Title - - - - - - - - <body>您的浏览器无法处理框架!</body> - - - \ No newline at end of file diff --git a/src/HTML/28.html b/src/HTML/28.html deleted file mode 100644 index 993dda4..0000000 --- a/src/HTML/28.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Title - - - - - - - \ No newline at end of file diff --git a/src/HTML/29.html b/src/HTML/29.html deleted file mode 100644 index 36e0b08..0000000 --- a/src/HTML/29.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - Title - - - - - - - - - -

W3School.com.cn

- - - - \ No newline at end of file diff --git a/src/HTML/3.html b/src/HTML/3.html deleted file mode 100644 index 9ed72be..0000000 --- a/src/HTML/3.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - Title - - - - - - - - - \ No newline at end of file diff --git a/src/HTML/30.html b/src/HTML/30.html deleted file mode 100644 index f17068a..0000000 --- a/src/HTML/30.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - Title - - - - - -

- 这是段落。这是段落。这是段落。这是段落。这是段落。这是段落。这是段落。这是段落。这是段落。这是段落。 -

-

- 这是另一个段落。这是另一个段落。这是另一个段落。这是另一个段落。这是另一个段落。这是另一个段落。这是另一个段落。 -

- - - - - -

图像背景

-

gif 和 jpg 文件均可用作 HTML 背景。

-

如果图像小于页面,图像会进行重复。

- - \ No newline at end of file diff --git a/src/HTML/31.html b/src/HTML/31.html deleted file mode 100644 index efdfd7e..0000000 --- a/src/HTML/31.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - Title - - - - - - - -

不支持 JavaScript 的浏览器将显示 noscript 元素中的文本。

- - - - - - - \ No newline at end of file diff --git a/src/HTML/32.html b/src/HTML/32.html deleted file mode 100644 index 4d606eb..0000000 --- a/src/HTML/32.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - Title - - - - - -view - - - \ No newline at end of file diff --git a/src/HTML/33.html b/src/HTML/33.html deleted file mode 100644 index 2d26a34..0000000 --- a/src/HTML/33.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - 标题不会显示在文档区 - - - - - - - - - - - -

- 这个连接 将在新窗口中加载,因为 target 属性被设置为 "_blank"。 -

- -

- 这个连接 也将在新窗口中加载,即使没有 target 属性。 -

-

- 对不起。我们已经搬家了。您的 URL 是 http://www.w3school.com.cn -

-

您将在 5 秒内被重定向到新的地址。

-

如果超过 5 秒后您仍然看到本消息,请点击上面的链接。

- - - - - - - - - - \ No newline at end of file diff --git a/src/HTML/34.html b/src/HTML/34.html deleted file mode 100644 index cdc2995..0000000 --- a/src/HTML/34.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - Title - - - - -

字符实体

-​ -

®

-​ -

用实体数字(比如"#174")或者实体名称(比如 "pound")替代 "X",然后查看结果。

- - - - \ No newline at end of file diff --git a/src/HTML/35.html b/src/HTML/35.html deleted file mode 100644 index 6ccaefe..0000000 --- a/src/HTML/35.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - Title - - - - - - - \ No newline at end of file diff --git a/src/HTML/36.html b/src/HTML/36.html deleted file mode 100644 index befe5cc..0000000 --- a/src/HTML/36.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - Title - - - - - diff --git a/src/HTML/37.html b/src/HTML/37.html deleted file mode 100644 index aa731db..0000000 --- a/src/HTML/37.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - Title - - - - - - - - - - \ No newline at end of file diff --git a/src/HTML/38.html b/src/HTML/38.html deleted file mode 100644 index 5d7a977..0000000 --- a/src/HTML/38.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - Title - - - - - - - - - \ No newline at end of file diff --git a/src/HTML/4.html b/src/HTML/4.html deleted file mode 100644 index 1035ef4..0000000 --- a/src/HTML/4.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - Title - - - - - -This is a link - -

拥有关于对齐方式的附加信息

- -人物关系表
- - - \ No newline at end of file diff --git a/src/HTML/40.html b/src/HTML/40.html deleted file mode 100644 index 7e2d932..0000000 --- a/src/HTML/40.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - Title - - - - - - \ No newline at end of file diff --git a/src/HTML/41.html b/src/HTML/41.html deleted file mode 100644 index e07d3aa..0000000 --- a/src/HTML/41.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - Title - - - - - - - - - \ No newline at end of file diff --git a/src/HTML/42.html b/src/HTML/42.html deleted file mode 100644 index 983af43..0000000 --- a/src/HTML/42.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - Title - - - - - - - - \ No newline at end of file diff --git a/src/HTML/43.html b/src/HTML/43.html deleted file mode 100644 index 673e712..0000000 --- a/src/HTML/43.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - Title - - - - - - - - \ No newline at end of file diff --git a/src/HTML/44.html b/src/HTML/44.html deleted file mode 100644 index 8a7e618..0000000 --- a/src/HTML/44.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - Title - - - - - - - -
- First name:
- -
- Last name:
- -

- -
- - - -
-First name:
- -
-Last name:
- -

- -
- -
-
- Personal information: - First name:
- -
- Last name:
- -

-
-
- - - \ No newline at end of file diff --git a/src/HTML/45.html b/src/HTML/45.html deleted file mode 100644 index 5a92a49..0000000 --- a/src/HTML/45.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - Title - - - - - - - - - - - -
- - - -
- - \ No newline at end of file diff --git a/src/HTML/46.html b/src/HTML/46.html deleted file mode 100644 index 3c76eec..0000000 --- a/src/HTML/46.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - Title - - - -
- First name:
- -
- Last name:
- -
- -
- User name:
- -
- User password:
- -
- -
- First name:
- -
- Last name:
- -

- -
- -
- Male -
- Female -
- -
- I have a bike -
- I have a car -
- - - \ No newline at end of file diff --git a/src/HTML/47.html b/src/HTML/47.html deleted file mode 100644 index 4e54cb8..0000000 --- a/src/HTML/47.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - Title - - - -
- First name:
- -
- Last name:
- -
- -
- First name:
- -
- Last name:
- -
- -
- First name:
- -
- Last name:
- -
- -
- First name:
- -
- Last name:
- -
- -
- First name:
- -
- Last name:
- -
- - \ No newline at end of file diff --git a/src/HTML/48.html b/src/HTML/48.html deleted file mode 100644 index 731d84e..0000000 --- a/src/HTML/48.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - Title - - - - - - - - - - - - Your browser does not support the canvas element. - - - - - - \ No newline at end of file diff --git a/src/HTML/49.html b/src/HTML/49.html deleted file mode 100644 index cdc043a..0000000 --- a/src/HTML/49.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - Title - - - - - - - - - - - \ No newline at end of file diff --git a/src/HTML/5.html b/src/HTML/5.html deleted file mode 100644 index ddd2e1e..0000000 --- a/src/HTML/5.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - Title - - - -

唐三

-

唐舞桐

-

唐舞麟

- -

This is a paragraph

-
-

This is a paragraph

-
-

This is a paragraph

- - \ No newline at end of file diff --git a/src/HTML/50.html b/src/HTML/50.html deleted file mode 100644 index a3137da..0000000 --- a/src/HTML/50.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - Title - - - - - - \ No newline at end of file diff --git a/src/HTML/51.html b/src/HTML/51.html deleted file mode 100644 index 929ae92..0000000 --- a/src/HTML/51.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - Title - - - - - - - \ No newline at end of file diff --git a/src/HTML/52.html b/src/HTML/52.html deleted file mode 100644 index 658a20a..0000000 --- a/src/HTML/52.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - Title - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/HTML/53.html b/src/HTML/53.html deleted file mode 100644 index e8b4b8d..0000000 --- a/src/HTML/53.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - Title - - - - - - - - - - - - -Play Sound - - - - -Play the sound - - \ No newline at end of file diff --git a/src/HTML/54.html b/src/HTML/54.html deleted file mode 100644 index 52165d5..0000000 --- a/src/HTML/54.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - Title - - - - - - - - - - - -Play a video file - - - - \ No newline at end of file diff --git a/src/HTML/6.html b/src/HTML/6.html deleted file mode 100644 index fda03bf..0000000 --- a/src/HTML/6.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - Title - - - - - -

This is
a para
graph with line breaks

- -

- 春眠不觉晓, - 处处闻啼鸟。 - 夜来风雨声, - 花落知多少。 -

- - - \ No newline at end of file diff --git a/src/HTML/7.html b/src/HTML/7.html deleted file mode 100644 index 7520679..0000000 --- a/src/HTML/7.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - Title - - - - -

标题背景

-

段落背景

- -

A heading

-

A paragraph.

- -

This is a heading

-

The heading above is aligned to the center of this page.

- - \ No newline at end of file diff --git a/src/HTML/8.html b/src/HTML/8.html deleted file mode 100644 index 8e95e7f..0000000 --- a/src/HTML/8.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - Title - - - -This text is bold -
-This text is strong -
-This text is big -
-This text is emphasized -
-This text is italic -
-This text is small -
-This text contains -subscript -
-This text contains -superscript - - -
-这是
-预格式文本。
-它保留了      空格
-和换行。
-
-

pre 标签很适合显示计算机代码:

-
-for i = 1 to 10
-     print i
-next i
-
- -Computer code -
-Keyboard input -
-Teletype text -
-Sample text -
-Computer variable -
-

- 注释:这些标签常用于显示计算机/编程代码。 -

- -
- Written by Donald Duck.
- Visit us at:
- Example.com
- Box 564, Disneyland
- USA -
- - \ No newline at end of file diff --git a/src/HTML/9.html b/src/HTML/9.html deleted file mode 100644 index 32fe818..0000000 --- a/src/HTML/9.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - Title - - - - -etc. -
-WWW -

在某些浏览器中,当您把鼠标移至缩略词语上时,title 可用于展示表达的完整版本。

-

仅对于 IE 5 中的 acronym 元素有效。

-

对于 Netscape 6.2 中的 abbr 和 acronym 元素都有效。

- -

- 如果您的浏览器支持 bi-directional override (bdo),下一行会从右向左输出 (rtl); -

- - Here is some Hebrew text - - - -这是长的引用: -
- 这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。这是长的引用。 -
- -这是短的引用: - - 这是短的引用。 - - -

- 使用 blockquote 元素的话,浏览器会插入换行和外边距,而 q 元素不会有任何特殊的呈现。 -

- -

一打有 二十 十二 件。

- -

大多数浏览器会改写为删除文本和下划线文本。

- -

一些老式的浏览器会把删除文本和下划线文本显示为普通文本。

- - \ No newline at end of file diff --git "a/src/HTML/resources/audio/\346\236\227\344\277\212\346\235\260 - \345\260\206\346\225\205\344\272\213\345\206\231\346\210\220\346\210\221\344\273\254.mp3" "b/src/HTML/resources/audio/\346\236\227\344\277\212\346\235\260 - \345\260\206\346\225\205\344\272\213\345\206\231\346\210\220\346\210\221\344\273\254.mp3" deleted file mode 100644 index 33b539a..0000000 Binary files "a/src/HTML/resources/audio/\346\236\227\344\277\212\346\235\260 - \345\260\206\346\225\205\344\272\213\345\206\231\346\210\220\346\210\221\344\273\254.mp3" and /dev/null differ diff --git "a/src/HTML/resources/images/\345\260\221\345\245\263\345\260\217\350\210\236.jpg" "b/src/HTML/resources/images/\345\260\221\345\245\263\345\260\217\350\210\236.jpg" deleted file mode 100644 index 12ce6b3..0000000 Binary files "a/src/HTML/resources/images/\345\260\221\345\245\263\345\260\217\350\210\236.jpg" and /dev/null differ diff --git "a/src/HTML/resources/images/\346\234\264\346\225\217\350\213\261.jpg" "b/src/HTML/resources/images/\346\234\264\346\225\217\350\213\261.jpg" deleted file mode 100644 index 82ab35e..0000000 Binary files "a/src/HTML/resources/images/\346\234\264\346\225\217\350\213\261.jpg" and /dev/null differ diff --git "a/src/HTML/resources/movie/\346\236\227\344\277\212\346\235\260-\345\260\206\346\225\205\344\272\213\345\206\231\346\210\220\346\210\221\344\273\254(\346\240\207\346\270\205).mp4" "b/src/HTML/resources/movie/\346\236\227\344\277\212\346\235\260-\345\260\206\346\225\205\344\272\213\345\206\231\346\210\220\346\210\221\344\273\254(\346\240\207\346\270\205).mp4" deleted file mode 100644 index eb8c024..0000000 Binary files "a/src/HTML/resources/movie/\346\236\227\344\277\212\346\235\260-\345\260\206\346\225\205\344\272\213\345\206\231\346\210\220\346\210\221\344\273\254(\346\240\207\346\270\205).mp4" and /dev/null differ diff --git "a/src/HTML/video/1.\346\210\221\347\232\204\347\254\254\344\270\200\344\270\252\347\275\221\351\241\265.html" "b/src/HTML/video/1.\346\210\221\347\232\204\347\254\254\344\270\200\344\270\252\347\275\221\351\241\265.html" deleted file mode 100644 index 02ea9b2..0000000 --- "a/src/HTML/video/1.\346\210\221\347\232\204\347\254\254\344\270\200\344\270\252\347\275\221\351\241\265.html" +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - 我的第一个网页 - - - -hello world - - \ No newline at end of file diff --git "a/src/HTML/video/10.\345\255\246\344\271\240\350\241\250\345\215\225.html" "b/src/HTML/video/10.\345\255\246\344\271\240\350\241\250\345\215\225.html" deleted file mode 100644 index dd33420..0000000 --- "a/src/HTML/video/10.\345\255\246\344\271\240\350\241\250\345\215\225.html" +++ /dev/null @@ -1,115 +0,0 @@ - - - - - 登录注册 - - - -

注册

-
- - -

名字:

- -

密码:

- -

性别: - 男 - 女 -

- -

爱好: - 睡觉 - 敲代码 - 聊天 - 游戏 -

- -

按钮: - - -

- -

国家: - -

- -

反馈: - -

- -

- - -

- -

邮箱 - -

- -

URL - -

- -

商品数量 - -

- -

滑块: - -

- -

搜索: - -

-

自定义邮箱: - - -

- - - -

- - -

-
- - \ No newline at end of file diff --git "a/src/HTML/video/2.\345\237\272\346\234\254\346\240\207\347\255\276.html" "b/src/HTML/video/2.\345\237\272\346\234\254\346\240\207\347\255\276.html" deleted file mode 100644 index 2e72cba..0000000 --- "a/src/HTML/video/2.\345\237\272\346\234\254\346\240\207\347\255\276.html" +++ /dev/null @@ -1,47 +0,0 @@ - - - - - 基本标签学习 - - - -

一级标签

-

二级标签

-

三级标签

-

四级标签

-
五级标签
-
六级标签
- -

听见 冬天 的离开

-

我在某年某月醒过来

-

我想 我等 我期待

-

未来却不能因此安排

- -
- -听见 冬天 的离开
-我在某年某月醒过来
-我想 我等 我期待
-未来却不能因此安排
- -

字体样式标签

-粗体: i love java -斜体:i love java - -
-空 格: -空格     格: -
-大于:> -
-小于:< -
-版权:© - - - - \ No newline at end of file diff --git "a/src/HTML/video/3.\345\233\276\345\203\217\346\240\207\347\255\276.html" "b/src/HTML/video/3.\345\233\276\345\203\217\346\240\207\347\255\276.html" deleted file mode 100644 index 9d8e549..0000000 --- "a/src/HTML/video/3.\345\233\276\345\203\217\346\240\207\347\255\276.html" +++ /dev/null @@ -1,16 +0,0 @@ - - - - - 图像标签学习 - - - -少女小舞 -跳转 - - \ No newline at end of file diff --git "a/src/HTML/video/4.\351\223\276\346\216\245\346\240\207\347\255\276.html" "b/src/HTML/video/4.\351\223\276\346\216\245\346\240\207\347\255\276.html" deleted file mode 100644 index 3653cd4..0000000 --- "a/src/HTML/video/4.\351\223\276\346\216\245\346\240\207\347\255\276.html" +++ /dev/null @@ -1,44 +0,0 @@ - - - - - 链接标签学习 - - - -顶部 - -点击我跳转到页面一 -点击我跳转到百度 -
- - 少女小舞 - -

- - 少女小舞 - -

-

- - 少女小舞 - -

- -回到顶部 -回到尾部 - - -点击联系我 - - 你好,和我一起学习 - - \ No newline at end of file diff --git "a/src/HTML/video/5.\345\210\227\350\241\250\346\240\207\347\255\276.html" "b/src/HTML/video/5.\345\210\227\350\241\250\346\240\207\347\255\276.html" deleted file mode 100644 index df16f40..0000000 --- "a/src/HTML/video/5.\345\210\227\350\241\250\346\240\207\347\255\276.html" +++ /dev/null @@ -1,41 +0,0 @@ - - - - - 列表学习 - - - -
    -
  1. java
  2. -
  3. python
  4. -
  5. spring
  6. -
  7. html
  8. -
-
- -
    -
  • java
  • -
  • python
  • -
  • spring
  • -
  • html
  • -
- -
-
技术
-
java
-
python
-
spring
-
- - - \ No newline at end of file diff --git "a/src/HTML/video/6.\350\241\250\346\240\274\346\240\207\347\255\276.html" "b/src/HTML/video/6.\350\241\250\346\240\274\346\240\207\347\255\276.html" deleted file mode 100644 index a845742..0000000 --- "a/src/HTML/video/6.\350\241\250\346\240\274\346\240\207\347\255\276.html" +++ /dev/null @@ -1,30 +0,0 @@ - - - - - 表格标签学习 - - - - - - - - - - - - - - - - - - - -
1-1
2-12-22-3
3-13-2
- - \ No newline at end of file diff --git "a/src/HTML/video/7.\345\252\222\344\275\223\345\205\203\347\264\240.html" "b/src/HTML/video/7.\345\252\222\344\275\223\345\205\203\347\264\240.html" deleted file mode 100644 index 3d429f3..0000000 --- "a/src/HTML/video/7.\345\252\222\344\275\223\345\205\203\347\264\240.html" +++ /dev/null @@ -1,16 +0,0 @@ - - - - - 媒体元素学习 - - - - - - - \ No newline at end of file diff --git "a/src/HTML/video/8.\351\241\265\351\235\242\347\273\223\346\236\204.html" "b/src/HTML/video/8.\351\241\265\351\235\242\347\273\223\346\236\204.html" deleted file mode 100644 index 03cdf4f..0000000 --- "a/src/HTML/video/8.\351\241\265\351\235\242\347\273\223\346\236\204.html" +++ /dev/null @@ -1,12 +0,0 @@ - - - - - 页面机构分析 - - -

网页头部

-

网页主体

-

网页脚部

- - \ No newline at end of file diff --git "a/src/HTML/video/9.\345\206\205\350\201\224\346\241\206\346\236\266iframe.html" "b/src/HTML/video/9.\345\206\205\350\201\224\346\241\206\346\236\266iframe.html" deleted file mode 100644 index 7600429..0000000 --- "a/src/HTML/video/9.\345\206\205\350\201\224\346\241\206\346\236\266iframe.html" +++ /dev/null @@ -1,18 +0,0 @@ - - - - - Title - - - - - - - -点击跳转 - - \ No newline at end of file diff --git "a/src/HTML/\345\260\221\345\245\263\345\260\217\350\210\236.jpg" "b/src/HTML/\345\260\221\345\245\263\345\260\217\350\210\236.jpg" deleted file mode 100644 index 12ce6b3..0000000 Binary files "a/src/HTML/\345\260\221\345\245\263\345\260\217\350\210\236.jpg" and /dev/null differ diff --git "a/src/JavaScript/lesson01/1.\346\210\221\347\232\204\347\254\254\344\270\200\344\270\252javaScript\347\250\213\345\272\217.html" "b/src/JavaScript/lesson01/1.\346\210\221\347\232\204\347\254\254\344\270\200\344\270\252javaScript\347\250\213\345\272\217.html" deleted file mode 100644 index 49d609d..0000000 --- "a/src/JavaScript/lesson01/1.\346\210\221\347\232\204\347\254\254\344\270\200\344\270\252javaScript\347\250\213\345\272\217.html" +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Title - - - - - - - - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson01/2.\345\237\272\346\234\254\350\257\255\346\263\225.html" "b/src/JavaScript/lesson01/2.\345\237\272\346\234\254\350\257\255\346\263\225.html" deleted file mode 100644 index d296938..0000000 --- "a/src/JavaScript/lesson01/2.\345\237\272\346\234\254\350\257\255\346\263\225.html" +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Title - - - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson01/3.\346\225\260\346\215\256\347\261\273\345\236\213.html" "b/src/JavaScript/lesson01/3.\346\225\260\346\215\256\347\261\273\345\236\213.html" deleted file mode 100644 index 77e42fd..0000000 --- "a/src/JavaScript/lesson01/3.\346\225\260\346\215\256\347\261\273\345\236\213.html" +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Title - - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson01/4.\344\270\245\346\240\274\346\243\200\346\237\245\346\250\241\345\274\217.html" "b/src/JavaScript/lesson01/4.\344\270\245\346\240\274\346\243\200\346\237\245\346\250\241\345\274\217.html" deleted file mode 100644 index 1fc6162..0000000 --- "a/src/JavaScript/lesson01/4.\344\270\245\346\240\274\346\243\200\346\237\245\346\250\241\345\274\217.html" +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Title - - - - - - \ No newline at end of file diff --git a/src/JavaScript/lesson01/qj.js b/src/JavaScript/lesson01/qj.js deleted file mode 100644 index 54c2a9a..0000000 --- a/src/JavaScript/lesson01/qj.js +++ /dev/null @@ -1 +0,0 @@ -alert('hello world') \ No newline at end of file diff --git "a/src/JavaScript/lesson02/1.\345\255\227\347\254\246\344\270\262.html" "b/src/JavaScript/lesson02/1.\345\255\227\347\254\246\344\270\262.html" deleted file mode 100644 index 8e26704..0000000 --- "a/src/JavaScript/lesson02/1.\345\255\227\347\254\246\344\270\262.html" +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Title - - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson02/2.\346\225\260\347\273\204.html" "b/src/JavaScript/lesson02/2.\346\225\260\347\273\204.html" deleted file mode 100644 index b2db9bf..0000000 --- "a/src/JavaScript/lesson02/2.\346\225\260\347\273\204.html" +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Title - - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson02/3.\345\257\271\350\261\241.html" "b/src/JavaScript/lesson02/3.\345\257\271\350\261\241.html" deleted file mode 100644 index 7fe90d9..0000000 --- "a/src/JavaScript/lesson02/3.\345\257\271\350\261\241.html" +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Title - - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson02/4.\345\210\206\346\224\257\345\222\214\345\276\252\347\216\257.html" "b/src/JavaScript/lesson02/4.\345\210\206\346\224\257\345\222\214\345\276\252\347\216\257.html" deleted file mode 100644 index 413c24c..0000000 --- "a/src/JavaScript/lesson02/4.\345\210\206\346\224\257\345\222\214\345\276\252\347\216\257.html" +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Title - - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson02/5.Map\345\222\214Set\351\233\206\345\220\210.html" "b/src/JavaScript/lesson02/5.Map\345\222\214Set\351\233\206\345\220\210.html" deleted file mode 100644 index d0f6f2f..0000000 --- "a/src/JavaScript/lesson02/5.Map\345\222\214Set\351\233\206\345\220\210.html" +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Title - - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson02/6.Iterable\350\277\255\344\273\243.html" "b/src/JavaScript/lesson02/6.Iterable\350\277\255\344\273\243.html" deleted file mode 100644 index dbad8c5..0000000 --- "a/src/JavaScript/lesson02/6.Iterable\350\277\255\344\273\243.html" +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Title - - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson03/1.\345\256\232\344\271\211\345\207\275\346\225\260.html" "b/src/JavaScript/lesson03/1.\345\256\232\344\271\211\345\207\275\346\225\260.html" deleted file mode 100644 index fb2498a..0000000 --- "a/src/JavaScript/lesson03/1.\345\256\232\344\271\211\345\207\275\346\225\260.html" +++ /dev/null @@ -1,43 +0,0 @@ - - - - - Title - - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson03/2.\345\217\230\351\207\217\344\275\234\347\224\250\345\237\237.html" "b/src/JavaScript/lesson03/2.\345\217\230\351\207\217\344\275\234\347\224\250\345\237\237.html" deleted file mode 100644 index 9b8047f..0000000 --- "a/src/JavaScript/lesson03/2.\345\217\230\351\207\217\344\275\234\347\224\250\345\237\237.html" +++ /dev/null @@ -1,71 +0,0 @@ - - - - - Title - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson03/3.\346\226\271\346\263\225.html" "b/src/JavaScript/lesson03/3.\346\226\271\346\263\225.html" deleted file mode 100644 index 05616e6..0000000 --- "a/src/JavaScript/lesson03/3.\346\226\271\346\263\225.html" +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Title - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson03/Date\345\257\271\350\261\241.html" "b/src/JavaScript/lesson03/Date\345\257\271\350\261\241.html" deleted file mode 100644 index 32bcf58..0000000 --- "a/src/JavaScript/lesson03/Date\345\257\271\350\261\241.html" +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Title - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson03/JSON\345\257\271\350\261\241.html" "b/src/JavaScript/lesson03/JSON\345\257\271\350\261\241.html" deleted file mode 100644 index f26d30c..0000000 --- "a/src/JavaScript/lesson03/JSON\345\257\271\350\261\241.html" +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Title - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson04/1.\351\235\242\345\220\221\345\257\271\350\261\241\345\216\237\345\236\213\347\273\247\346\211\277.html" "b/src/JavaScript/lesson04/1.\351\235\242\345\220\221\345\257\271\350\261\241\345\216\237\345\236\213\347\273\247\346\211\277.html" deleted file mode 100644 index 642aee4..0000000 --- "a/src/JavaScript/lesson04/1.\351\235\242\345\220\221\345\257\271\350\261\241\345\216\237\345\236\213\347\273\247\346\211\277.html" +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Title - - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson04/3.\346\223\215\344\275\234BOM\345\257\271\350\261\241.html" "b/src/JavaScript/lesson04/3.\346\223\215\344\275\234BOM\345\257\271\350\261\241.html" deleted file mode 100644 index d5741c0..0000000 --- "a/src/JavaScript/lesson04/3.\346\223\215\344\275\234BOM\345\257\271\350\261\241.html" +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Title - - - - - \ No newline at end of file diff --git a/src/JavaScript/lesson04/4.Document.html b/src/JavaScript/lesson04/4.Document.html deleted file mode 100644 index 566549b..0000000 --- a/src/JavaScript/lesson04/4.Document.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Title - - - - - \ No newline at end of file diff --git "a/src/JavaScript/lesson05/1.\350\216\267\345\217\226DOM\347\273\223\347\202\271.html" "b/src/JavaScript/lesson05/1.\350\216\267\345\217\226DOM\347\273\223\347\202\271.html" deleted file mode 100644 index 8687347..0000000 --- "a/src/JavaScript/lesson05/1.\350\216\267\345\217\226DOM\347\273\223\347\202\271.html" +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Title - - -
-

标题一

-

p1

-

p2

-
- - - \ No newline at end of file diff --git "a/src/JavaScript/lesson05/2.\346\233\264\346\226\260\347\273\223\347\202\271.html" "b/src/JavaScript/lesson05/2.\346\233\264\346\226\260\347\273\223\347\202\271.html" deleted file mode 100644 index 8380e6f..0000000 --- "a/src/JavaScript/lesson05/2.\346\233\264\346\226\260\347\273\223\347\202\271.html" +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Title - - -
- -
- - - \ No newline at end of file diff --git "a/src/JavaScript/lesson05/3.\345\210\240\351\231\244\347\273\223\347\202\271.html" "b/src/JavaScript/lesson05/3.\345\210\240\351\231\244\347\273\223\347\202\271.html" deleted file mode 100644 index 0144c0e..0000000 --- "a/src/JavaScript/lesson05/3.\345\210\240\351\231\244\347\273\223\347\202\271.html" +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Title - - -
-

标题一

-

p1

-

p2

-
- - - \ No newline at end of file diff --git "a/src/JavaScript/lesson05/4.\346\217\222\345\205\245\347\273\223\347\202\271.html" "b/src/JavaScript/lesson05/4.\346\217\222\345\205\245\347\273\223\347\202\271.html" deleted file mode 100644 index 891172f..0000000 --- "a/src/JavaScript/lesson05/4.\346\217\222\345\205\245\347\273\223\347\202\271.html" +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Title - - -

JavaScript

-
-

JavaSE

-

JavaEE

-

javaME

-
- - - \ No newline at end of file diff --git "a/src/JavaScript/lesson06/1.\346\223\215\344\275\234\350\241\250\345\215\225.html" "b/src/JavaScript/lesson06/1.\346\223\215\344\275\234\350\241\250\345\215\225.html" deleted file mode 100644 index b881b45..0000000 --- "a/src/JavaScript/lesson06/1.\346\223\215\344\275\234\350\241\250\345\215\225.html" +++ /dev/null @@ -1,36 +0,0 @@ - - - - - Title - - -
-

- 用户名 -

- -

- 性别: - 男 - 女 -

-
- - - \ No newline at end of file diff --git "a/src/JavaScript/lesson06/2.\346\217\220\344\272\244\350\241\250\345\215\225.html" "b/src/JavaScript/lesson06/2.\346\217\220\344\272\244\350\241\250\345\215\225.html" deleted file mode 100644 index b69b8ad..0000000 --- "a/src/JavaScript/lesson06/2.\346\217\220\344\272\244\350\241\250\345\215\225.html" +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Title - - - - - -
-

- 用户名: -

-

- 密码: -

- - - -
- - \ No newline at end of file diff --git a/src/Json/JsonStrList.java b/src/Json/JsonStrList.java new file mode 100644 index 0000000..299eda5 --- /dev/null +++ b/src/Json/JsonStrList.java @@ -0,0 +1,29 @@ +package Json; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author lifei + * @date 2020/7/1 10:38 + */ +public class JsonStrList { + public static void main(String[] args) { + List stuList=new ArrayList<>(); + stuList.add(new Student("aa",22)); + stuList.add(new Student("cc",20)); + //stuList->jsonString + Gson gson=new Gson(); + String s = gson.toJson(stuList); + System.out.println(s); + //jsonString->stuList +// List list = gson.fromJson(s, List.class); +// System.out.println(list.get(0)); + //使用typeToken + List list = gson.fromJson(s, new TypeToken>() {}.getType()); + System.out.println(list); + } +} diff --git a/src/Json/JsonStrMap.java b/src/Json/JsonStrMap.java new file mode 100644 index 0000000..2b15a6f --- /dev/null +++ b/src/Json/JsonStrMap.java @@ -0,0 +1,26 @@ +package Json; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author lifei + * @date 2020/7/1 11:52 + */ +public class JsonStrMap { + public static void main(String[] args) { + Map map=new HashMap<>(); + map.put("aa",new Student("aa",18)); + map.put("bb",new Student("bb",16)); + //map->jsonString + Gson gson=new Gson(); + String s = gson.toJson(map);//{"aa":{"name":"aa","age":18},"bb":{"name":"bb","age":16}} + System.out.println(s); + //jsonString->map + Map c= gson.fromJson(s, new TypeToken>() {}.getType()); + System.out.println(c.get("aa")); + } +} diff --git a/src/Json/JsonStrObject.java b/src/Json/JsonStrObject.java new file mode 100644 index 0000000..d6289b4 --- /dev/null +++ b/src/Json/JsonStrObject.java @@ -0,0 +1,20 @@ +package Json; + +import com.google.gson.Gson; + +/** + * @author lifei + * @date 2020/7/1 10:26 + */ +public class JsonStrObject { + public static void main(String[] args) { + Gson gson=new Gson(); + Student stu=new Student("aa",18); + //student->jsonString + String s = gson.toJson(stu); + System.out.println(s); + //jsonString->Student + Student student = gson.fromJson(s, Student.class); + System.out.println(student.toString()); + } +} diff --git a/src/Json/Student.java b/src/Json/Student.java new file mode 100644 index 0000000..ce945b4 --- /dev/null +++ b/src/Json/Student.java @@ -0,0 +1,39 @@ +package Json; + +/** + * @author lifei + * @date 2020/7/1 10:27 + */ +public class Student { + private String name; + private int age; + + public Student(String name, int age) { + this.name = name; + this.age = age; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + return "Student{" + + "name='" + name + '\'' + + ", age=" + age + + '}'; + } +} diff --git a/src/Listener/ApplicationlistenerDemo.java b/src/Listener/ApplicationlistenerDemo.java new file mode 100644 index 0000000..6077129 --- /dev/null +++ b/src/Listener/ApplicationlistenerDemo.java @@ -0,0 +1,21 @@ +package Listener; + +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; + +/** + * @author lifei + * @date 2020/6/30 10:26 + */ +public class ApplicationlistenerDemo implements ServletContextListener { + + @Override + public void contextInitialized(ServletContextEvent servletContextEvent) { + System.out.println("application init"); + } + + @Override + public void contextDestroyed(ServletContextEvent servletContextEvent) { + System.out.println("application destroy"); + } +} diff --git a/src/Servlet/CreateCookieServlet.java b/src/Servlet/CreateCookieServlet.java new file mode 100644 index 0000000..d18a23a --- /dev/null +++ b/src/Servlet/CreateCookieServlet.java @@ -0,0 +1,23 @@ +package Servlet; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name = "CreateCookieServlet") +public class CreateCookieServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //创建Cookie对象并携带信息 + Cookie cookieName=new Cookie("stuName","aa"); + //响应给客户端 + response.addCookie(cookieName); + } +} diff --git a/src/Servlet/FormRepeatServlet.java b/src/Servlet/FormRepeatServlet.java new file mode 100644 index 0000000..f97ce16 --- /dev/null +++ b/src/Servlet/FormRepeatServlet.java @@ -0,0 +1,31 @@ +package Servlet; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.IOException; + +@WebServlet(name = "FormRepeatServlet") +public class FormRepeatServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //分别取session域和隐藏域的uuid值 + String uuid2 = request.getParameter("uuid2"); + HttpSession session=request.getSession(); + Object uuid = session.getAttribute("uuid"); + // 判断是否相等 + if(uuid!=null&&uuid.toString().equals(uuid2)){ + //相等,提交,移除session域中的token + System.out.println("summit"); + session.removeAttribute("uuid"); + } + System.out.println("end!"); + + } +} diff --git a/src/Servlet/GetCookieServlet.java b/src/Servlet/GetCookieServlet.java new file mode 100644 index 0000000..30c1252 --- /dev/null +++ b/src/Servlet/GetCookieServlet.java @@ -0,0 +1,24 @@ +package Servlet; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name = "GetCookieServlet") +public class GetCookieServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //获取cookie + Cookie[] cookies = request.getCookies(); + for (Cookie cur:cookies){ + System.out.println(cur.getName()+","+cur.getValue()); + } + } +} diff --git a/src/Servlet/GetSessionServlet.java b/src/Servlet/GetSessionServlet.java new file mode 100644 index 0000000..5a3cffe --- /dev/null +++ b/src/Servlet/GetSessionServlet.java @@ -0,0 +1,19 @@ +package Servlet; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name = "GetSessionServlet") +public class GetSessionServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + System.out.println(request.getSession().getId()); + } +} diff --git a/src/Servlet/HelloServlet.java b/src/Servlet/HelloServlet.java new file mode 100644 index 0000000..bf1a5f4 --- /dev/null +++ b/src/Servlet/HelloServlet.java @@ -0,0 +1,49 @@ +package Servlet; + +import javax.servlet.Servlet; +import javax.servlet.ServletConfig; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import java.io.IOException; + +/** + * @author lifei + * @date 2020/6/25 10:36 + */ + +public class HelloServlet implements Servlet{ + private ServletConfig servletConfig; + // 创建servlet对象后执行init + public void init(ServletConfig servletConfig) { + this.servletConfig=servletConfig; + } + + public ServletConfig getServletConfig() { + return null; + } +/* +处理用户的请求 + */ + public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws IOException { + System.out.println("service()!!!"); + String encode = servletConfig.getInitParameter("encode"); + System.out.println(encode); + System.out.println(servletConfig.getServletContext()); + System.out.println(servletConfig.getServletName()); + //获取上下文的参数 + System.out.println(servletConfig.getServletContext().getInitParameter("gae")); + //获取真实路径 + servletConfig.getServletContext().getRealPath("HelloServlet.class"); + + } + + public String getServletInfo() { + return null; + } + //servlet消亡时执行 + public void destroy() { + + } +} + + diff --git a/src/Servlet/KeepCookieServlet.java b/src/Servlet/KeepCookieServlet.java new file mode 100644 index 0000000..fb0495d --- /dev/null +++ b/src/Servlet/KeepCookieServlet.java @@ -0,0 +1,27 @@ +package Servlet; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name = "KeepCookieServlet") +public class KeepCookieServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //创建cookie + Cookie cookie=new Cookie("stuAge","18"); + //持久化cookie + //cookie.setMaxAge(60);//60为秒数 + //有效路径 + cookie.setPath(request.getContextPath()+"/a"); + response.addCookie(cookie); + + } +} diff --git a/src/Servlet/KeepSessionServlet.java b/src/Servlet/KeepSessionServlet.java new file mode 100644 index 0000000..c8cab2a --- /dev/null +++ b/src/Servlet/KeepSessionServlet.java @@ -0,0 +1,31 @@ +package Servlet; + +import Demo.Student; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.*; +import java.io.IOException; + +@WebServlet(name = "KeepSessionServlet") +public class KeepSessionServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //持久化Session->持久化特殊的Cookie + Cookie[] cookies = request.getCookies(); + for (Cookie c:cookies){ + if("JSESSIONID".equals(c.getName())){ + c.setMaxAge(600); + response.addCookie(c); + break; + } + } + //设置session的非活动时间 + HttpSession session=request.getSession(); + session.setMaxInactiveInterval(600);//秒数 + session.setAttribute("stu", new Student("aa",1)); + } +} diff --git a/src/Servlet/LoginServlet.java b/src/Servlet/LoginServlet.java new file mode 100644 index 0000000..0b03813 --- /dev/null +++ b/src/Servlet/LoginServlet.java @@ -0,0 +1,37 @@ +package Servlet; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name = "LoginServlet") +public class LoginServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + } + /* + 实现登录功能 + 1.获取用户名和密码 + 2.判断用户名和密码是否正确(admin,dao) + 3.路径跳转 + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //1.获取用户名和密码 + //response.setContentType("text/html;charset=utf-8"); + String username = request.getParameter("username"); + System.out.println(username); + String password = request.getParameter("password"); + // 2.判断用户名和密码是否正确(admin,dao) + if("admin2".equals(username)&&"admin2".equals(password)){ + //登录成功 转发跳转 + RequestDispatcher requestDispatcher = request.getRequestDispatcher("HTML/login_success.html"); + requestDispatcher.forward(request,response); + }else{//重定向跳转 + response.sendRedirect("HTML/loginDemo.html"); + } + + } +} diff --git a/src/Servlet/MyServlet.java b/src/Servlet/MyServlet.java new file mode 100644 index 0000000..0c1a007 --- /dev/null +++ b/src/Servlet/MyServlet.java @@ -0,0 +1,46 @@ +package Servlet; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; + +@WebServlet(name = "MyServlet") +public class MyServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //测试response + System.out.println("doPost()"); + //1.服务器向客户端做出响应(文本|html) + //获取响应流 + response.setContentType("text/html;charset=utf-8"); + PrintWriter writer = response.getWriter(); + //响应 + // writer.write("login success!"); + writer.write("

登录login success!

"); + //3.重定向 + //response.sendRedirect("HTML/login_success.html"); + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //测试request对象 + + System.out.println("doGet()"); + //1.获取请求参数,通过name获取 + String username = request.getParameter("username"); + System.out.println(username); + //2.获取项目虚拟路径 + String contextPath = request.getContextPath(); + System.out.println(contextPath); + //转发 web\HTML\login_success.html + //1.获取转发器, + RequestDispatcher requestDispatcher = request.getRequestDispatcher("HTML/login_success.html"); + //2,执行转发 + requestDispatcher.forward(request,response); + } + +} diff --git a/src/Servlet/RegistServlet.java b/src/Servlet/RegistServlet.java new file mode 100644 index 0000000..d3b34c0 --- /dev/null +++ b/src/Servlet/RegistServlet.java @@ -0,0 +1,38 @@ +package Servlet; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name = "RegistServlet") +public class RegistServlet extends HttpServlet { + /* + 实现伪注册 + 1.获取用户名和密码 + 1_2. + 校验用户名是否存在 + //2.调用dao接口,将用户名和密码保存到数据库 + 3.跳转 + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //1.获取用户名和密码 + String username = request.getParameter("username"); + //校验用户名是否存在 + if("admin2".equals(username)){ + //用户名已存在,注册失败,重定向 + response.sendRedirect("HTML/RegistDemo.html"); + }else{ + //用户名可以,注册成功,转发 + RequestDispatcher requestDispatcher = request.getRequestDispatcher("HTML/regist_success.html"); + requestDispatcher.forward(request,response); + } + } +} diff --git a/src/Servlet/RemoveSessionServlet.java b/src/Servlet/RemoveSessionServlet.java new file mode 100644 index 0000000..0944e1a --- /dev/null +++ b/src/Servlet/RemoveSessionServlet.java @@ -0,0 +1,22 @@ +package Servlet; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import java.io.IOException; + +@WebServlet(name = "RemoveSessionServlet") +public class RemoveSessionServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + HttpSession session = request.getSession(); + //设置session失效 + session.invalidate(); + } +} diff --git a/src/Servlet/UpdateCookieServlet.java b/src/Servlet/UpdateCookieServlet.java new file mode 100644 index 0000000..a02308c --- /dev/null +++ b/src/Servlet/UpdateCookieServlet.java @@ -0,0 +1,31 @@ +package Servlet; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name = "UpdateCookieServlet") +public class UpdateCookieServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //覆盖式修改 +// Cookie cookieName=new Cookie("stuName","bb"); +// response.addCookie(cookieName); + //直接式修改 + Cookie[]cookies=request.getCookies(); + for (Cookie cookie:cookies){ + if("stuName".equals(cookie.getName())){ + cookie.setValue("cc"); + response.addCookie(cookie); + break; + } + } + } +} diff --git a/src/Servlet/UserCookieServlet.java b/src/Servlet/UserCookieServlet.java new file mode 100644 index 0000000..f234108 --- /dev/null +++ b/src/Servlet/UserCookieServlet.java @@ -0,0 +1,36 @@ +package Servlet; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name = "UserServlet") +public class UserCookieServlet extends HttpServlet { + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + } + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String username = request.getParameter("username"); + String password = request.getParameter("password"); + String rp=request.getParameter("rp"); + if(rp==null){//如果未勾选 + return; + } + //如果勾选 + //将数据存放Cookie中 + Cookie cookieName=new Cookie("username",username); + Cookie cookiePwd=new Cookie("password",password); + //将Cookie持久化 + cookieName.setMaxAge(60*60*24*7);//7天 + cookiePwd.setMaxAge(60*60*24*7); + //将Cookie响应给浏览器 + response.addCookie(cookieName); + response.addCookie(cookiePwd); + //调转 + } +} diff --git a/src/XML/Class/Dom4jTest.java b/src/XML/Class/Dom4jTest.java deleted file mode 100644 index 8037a20..0000000 --- a/src/XML/Class/Dom4jTest.java +++ /dev/null @@ -1,34 +0,0 @@ -package XML.Class; - -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.Element; -import org.dom4j.io.SAXReader; - -import java.util.Iterator; - -/** - * @authtor liFei - * @date 2020/6/22-11:13 - */ -public class Dom4jTest {//dom4j 加载完整个文档到内存再解析 - public static void main(String[] args) throws DocumentException { - //创建解析器 - SAXReader reader=new SAXReader(); - //通过解析器的read方法将配置文件读取到内存中,生成一个Document[org.dom4j]对象树 - Document document=reader.read("D:\\Practice\\JavaWeb\\src\\XML\\xml\\students.xml"); - //获取根节点 - Element root = document.getRootElement(); - //开始遍历根节点 - Iterator rootIter=root.elementIterator(); - while (rootIter.hasNext()){ - Element studentElt= rootIter.next(); - Iterator childIter=studentElt.elementIterator(); - while (childIter.hasNext()){ - Element innerElt=childIter.next(); - System.out.println(innerElt.getStringValue()); - } - System.out.println("========================================"); - } - } -} diff --git a/src/XML/Class/SAXParserTest.java b/src/XML/Class/SAXParserTest.java deleted file mode 100644 index 63e4e3b..0000000 --- a/src/XML/Class/SAXParserTest.java +++ /dev/null @@ -1,45 +0,0 @@ -package XML.Class; - -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; -import java.io.IOException; - -/** - * @authtor liFei - * @date 2020/6/22-11:47 - */ -public class SAXParserTest { - static class MyDefaultHandler extends DefaultHandler { - @Override - public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { - //super.startElement(uri, localName, qName, attributes); - System.out.print("<"+qName+">"); - } - - @Override - public void endElement(String uri, String localName, String qName) throws SAXException { - //super.endElement(uri, localName, qName); - System.out.print(""); - } - - @Override - public void characters(char[] ch, int start, int length) throws SAXException { - //super.characters(ch, start, length); - System.out.print(new String(ch,start,length)); - } - } - public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException {//边解读边解析,适合解析大文本文件 - //创建解析工程 - SAXParserFactory saxParserFactory=SAXParserFactory.newInstance(); - //创建解析器 - SAXParser saxParser = saxParserFactory.newSAXParser(); - //通过解析器的parser方法 - saxParser.parse("D:\\Practice\\JavaWeb\\src\\XML\\xml\\students.xml",new MyDefaultHandler()); - - } -} diff --git a/src/XML/Class/ServerParser.java b/src/XML/Class/ServerParser.java deleted file mode 100644 index 5533e00..0000000 --- a/src/XML/Class/ServerParser.java +++ /dev/null @@ -1,29 +0,0 @@ -package XML.Class; - -import org.dom4j.Attribute; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.Element; -import org.dom4j.io.SAXReader; - -/** - * @authtor liFei - * @date 2020/6/23-9:51 - */ -public class ServerParser { - public static void main(String[] args) throws DocumentException { - //创建解析器 - SAXReader saxReader=new SAXReader(); - //通过解析器的reader将配置文件读取到内存中,生成一个Document[org.dom4j]对象树 - Document document=saxReader.read("D:\\Practice\\JavaWeb\\src\\XML\\xml\\server.xml"); - //获取connector结点对象的路径:server->service->connector - //获取connector结点元素对象的xpath路径:/server/service/connector server//connector //connector - Element connectorElt = (Element)document.selectSingleNode("server//connector"); - //获取connectorELt结点元素对象的port属性对象 - Attribute portAttr=connectorElt.attribute("port"); - //获取portAttr属性对象的值 - String port=portAttr.getStringValue(); - System.out.println(port); - //System.out.println(connectorElt.attributeValue("port")); - } -} diff --git a/src/XML/Class/SysConfigParser.java b/src/XML/Class/SysConfigParser.java deleted file mode 100644 index e3321f4..0000000 --- a/src/XML/Class/SysConfigParser.java +++ /dev/null @@ -1,50 +0,0 @@ -package XML.Class; - -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.Element; -import org.dom4j.io.SAXReader; - -/** - * @authtor liFei - * @date 2020/6/22-19:51 - */ -public class SysConfigParser { - public static void main(String[] args) throws DocumentException { - //创建解析器 - SAXReader reader = new SAXReader(); - //通过解析器的reader将配置文件读取到内存中,生成一个Document[org.dom4j]对象树 - Document document=reader.read("D:\\Practice\\JavaWeb\\src\\XML\\xml\\sys-config.xml"); - - //driver-name结点元素的路径 config->database-info->driver-name - //driver-name结点元素的xpath路径:/config/database-info/driver-name - Element driverNameElt =(Element) document.selectSingleNode("/config/database-info/driver-name"); - //获取driverNameElt结点元素对象的文本内容 - String driverName= driverNameElt.getStringValue(); - System.out.println(driverName); - - //url结点元素路径:config->database-info->url - //url结点元素的xpath路径:/config/database-info/url 或者//url 或者 config//url - Element urlNameElt =(Element) document.selectSingleNode("config//url"); - //获取driverNameElt结点元素对象的文本内容 - String urlName= urlNameElt.getStringValue(); - System.out.println(urlName); - - - //user结点元素路径:config->database-info->user - //url结点元素的xpath路径:/config/database-info/user 或者//user 或者 config//user - Element uesrNameElt =(Element) document.selectSingleNode("//uesr"); - //获取driverNameElt结点元素对象的文本内容 - String uesrName= uesrNameElt.getStringValue(); - System.out.println(uesrName); - //该方法也可以 - //Element element=(Element) document.selectObject("//uesr"); - //System.out.println(element.getStringValue()); - - - //password结点元素路径:config->database-info->password - //password结点元素的xpath路径:/config/database-info/password 或者//password 或者 config//password - Element element=(Element) document.selectObject("//password"); - System.out.println(element.getStringValue()); - } -} \ No newline at end of file diff --git a/src/XML/Class/XPathTest.java b/src/XML/Class/XPathTest.java deleted file mode 100644 index 43fc418..0000000 --- a/src/XML/Class/XPathTest.java +++ /dev/null @@ -1,70 +0,0 @@ -package XML.Class; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; -import java.io.IOException; - -/** - * @authtor liFei - * @date 2020/6/23-10:09 - */ -public class XPathTest { - public static void main(String[] args) throws ParserConfigurationException, IOException, SAXException, XPathExpressionException { - //创建解析工厂 - DocumentBuilderFactory documentBuilderFactory=DocumentBuilderFactory.newInstance(); - //创建解析器 - DocumentBuilder builder = documentBuilderFactory.newDocumentBuilder(); - //通过解析器来读取配置文件,生成一个Document[org.w3c.dom]对象树 - Document document = builder.parse("D:\\Practice\\JavaWeb\\src\\XML\\xml\\books.xml"); - //创建Xpath对象 - XPath xPath = XPathFactory.newInstance().newXPath(); - /* - 1.获取bookstore结点下book属性category值为web下的第二个title结点的文本内容 - bookstore->book[@category="web"][2]->title - xpath路径:/bookstore/book[@category="web"][2]/title/text(); - */ - String titleXpath="/bookstore/book[@category='web'][2]/title/text()"; - String titleValue=(String)xPath.evaluate(titleXpath,document, XPathConstants.STRING); - System.out.println(titleValue); - /* - 2.获取bookstore结点下book属性categoty值为web的title属性为en的结点内容 - */ - String enXpath="/bookstore/book[@category='web']/title[@lang='en']/text()"; - String enValue=(String)xPath.evaluate(enXpath,document,XPathConstants.STRING); - System.out.println(enValue); - /* - 3.获取bookstore下book属性category值为cooking的title的lang属性的值 - */ - String langXpath="/bookstore/book[@category='cooking']/title/@lang"; - String langValue=(String)xPath.evaluate(langXpath,document,XPathConstants.STRING); - System.out.println(langValue); - /* - 4.获取bookstore结点下所有book的结点集合 - */ - - NodeList bookList=(NodeList) xPath.evaluate("/bookstore/book",document,XPathConstants.NODESET); - for (int i = 0; i - - - Harry Potter - J K.Rowling - 2005 - 29.9 - - - Everyday Italian - Giada De Laurentiis - 2005 - 30.0 - - - learning XML - Erik T.Ray - 2003 - 39.9 - - - XQuery Kick Start - James McGovern - 2003 - 49.9 - - \ No newline at end of file diff --git a/src/XML/xml/server.xml b/src/XML/xml/server.xml deleted file mode 100644 index 884d59b..0000000 --- a/src/XML/xml/server.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/XML/xml/students.xml b/src/XML/xml/students.xml deleted file mode 100644 index 2dd74cd..0000000 --- a/src/XML/xml/students.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - 吴峰 - 计算机学院 - 152525 - 男,2000年,本科,现在就读于邮电大学 - - - 韩清 - 传媒学院 - 152525 - 女,2000年,本科,现在就读于传媒大学 - - - Jack - 外国语学院 - 1311856 - 男,2000年,本科,现在就读于外国语大学 - - \ No newline at end of file diff --git a/src/XML/xml/sys-config.xml b/src/XML/xml/sys-config.xml deleted file mode 100644 index ade3774..0000000 --- a/src/XML/xml/sys-config.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - com.mysql.jdbc - jdbc:mysql://192.168.1.151:8080 - root - 123 - - \ No newline at end of file diff --git a/web/Ajax/AjaxDemo.jsp b/web/Ajax/AjaxDemo.jsp new file mode 100644 index 0000000..54e32ce --- /dev/null +++ b/web/Ajax/AjaxDemo.jsp @@ -0,0 +1,50 @@ +<%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/7/1 + Time: 9:06 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + + + + + + + diff --git a/web/Cookie/cookieDemo.jsp b/web/Cookie/cookieDemo.jsp new file mode 100644 index 0000000..377d883 --- /dev/null +++ b/web/Cookie/cookieDemo.jsp @@ -0,0 +1,20 @@ +<%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/6/28 + Time: 8:15 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +

cookieDemo

+创建cookie对象 +获取cookie对象 +修改cookie对象 +持久化cookie对象 + + diff --git a/web/Cookie/login.jsp b/web/Cookie/login.jsp new file mode 100644 index 0000000..6f479d7 --- /dev/null +++ b/web/Cookie/login.jsp @@ -0,0 +1,34 @@ +<%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/6/28 + Time: 10:17 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +
+ + + + + + + + + + + + + + + + +
用户名:
密码:
记住密码:
+
+ + diff --git a/src/CSS/lesson06/11.jpg b/web/File/download/11.jpg similarity index 100% rename from src/CSS/lesson06/11.jpg rename to web/File/download/11.jpg diff --git a/web/File/download/2020.7.3.txt b/web/File/download/2020.7.3.txt new file mode 100644 index 0000000..f188e06 --- /dev/null +++ b/web/File/download/2020.7.3.txt @@ -0,0 +1,9 @@ +240. 搜索二维矩阵 II +从左下角开始,如果当前元素大于目标值,则行数上移,如果当前元素值小于目标值,则列数右移即可,直到直到结果或者行列超出范围即可 +264. 丑数 II +定义长度为n的数组,并且num[0]=1,然后定义三个指针p1,p2,p3,初始化都为0,从i开始遍历数组,每轮的num[i]=num[p1]*2,num[p2]*3,num[p3]*5的最小值,然后如果num[i]=num[p1]*2,p1后移,其余两个都进行判断(防止出现比较的三个值中出现相同的情况),这样的正确性是所有的丑数都是有前面一个丑数*2,*3,*5得到的,而假设num[p1]*2已经出现了,后面就没必要拿它*2比了,应该找到下一个丑数(*2)加入下轮比较 +274. H 指数 +1.排序:将数组进行降序排列,由于Arrays.sort()是升序排序,所以遍历时倒着来。只要当前论文的引用量大于i,则i++,最后返回i即可。 +2:计数:新建一个数组num,遍历原数组,如果当前值大于等于n,则num[n]++,否则num[cur]++,然后从i=n开始,记录此时已经引用的论文数量,如果count>=i,就返回i,否则返回0 +275. H指数 II +二分搜索,如果当前中间值等于数组长度-mid,则直接返回,因为此时无论往前走(论文引用数量减少)还是往后(论文数量减少)走都无法超过该值,如果小于数组长度-mid,则left=mid+1,比如citations[mid]=2,len-mid=4,则可能还存在一个更大的值满足条件,所以往后走,同理,大于数组长度-mid,则right=mid-1。退出循环后返回数组长度-left。 \ No newline at end of file diff --git a/web/File/file_download.jsp b/web/File/file_download.jsp new file mode 100644 index 0000000..c19feab --- /dev/null +++ b/web/File/file_download.jsp @@ -0,0 +1,20 @@ +<%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/7/2 + Time: 10:13 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + 文件下载 + + +

文件商店

+<%--11.jpg--%> +11.jpg +2020.7.3.txt +位置指纹算法.pdf + + diff --git a/web/File/file_upload.jsp b/web/File/file_upload.jsp new file mode 100644 index 0000000..09dfde3 --- /dev/null +++ b/web/File/file_upload.jsp @@ -0,0 +1,21 @@ +<%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/7/2 + Time: 8:39 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + 文件上传 + + +

文件上传

+
+ 姓名:
+ 上传文件:
+ +
+ + diff --git a/web/Filter/filter.jsp b/web/Filter/filter.jsp new file mode 100644 index 0000000..8cd4da3 --- /dev/null +++ b/web/Filter/filter.jsp @@ -0,0 +1,18 @@ +<%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/6/30 + Time: 8:49 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<%--helloFilter--%> +helloFilter
+httpFilterTest + + diff --git a/web/HTML/RegistDemo.html b/web/HTML/RegistDemo.html new file mode 100644 index 0000000..9d3a51a --- /dev/null +++ b/web/HTML/RegistDemo.html @@ -0,0 +1,24 @@ + + + + + Title + + +
+ + + + + + + + + + + + +
用户名:
密码:
+
+ + \ No newline at end of file diff --git a/web/HTML/login.html b/web/HTML/login.html new file mode 100644 index 0000000..5acf1b5 --- /dev/null +++ b/web/HTML/login.html @@ -0,0 +1,40 @@ + + + + + Title + + +
+ + + + + + + + + + + + +
用户名:
密码:
+
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web/HTML/loginDemo.html b/web/HTML/loginDemo.html new file mode 100644 index 0000000..0936d4b --- /dev/null +++ b/web/HTML/loginDemo.html @@ -0,0 +1,24 @@ + + + + + Title + + +
+ + + + + + + + + + + + +
用户名:
密码:
+
+ + \ No newline at end of file diff --git "a/src/CSS/lesson3/3.id\351\200\211\346\213\251\345\231\250.html" b/web/HTML/login_success.html similarity index 74% rename from "src/CSS/lesson3/3.id\351\200\211\346\213\251\345\231\250.html" rename to web/HTML/login_success.html index 566549b..0c892bb 100644 --- "a/src/CSS/lesson3/3.id\351\200\211\346\213\251\345\231\250.html" +++ b/web/HTML/login_success.html @@ -5,6 +5,6 @@ Title - +

登录成功

\ No newline at end of file diff --git "a/src/JavaScript/lesson04/2.class\347\273\247\346\211\277.html" b/web/HTML/p.html similarity index 77% rename from "src/JavaScript/lesson04/2.class\347\273\247\346\211\277.html" rename to web/HTML/p.html index 566549b..31be1fb 100644 --- "a/src/JavaScript/lesson04/2.class\347\273\247\346\211\277.html" +++ b/web/HTML/p.html @@ -5,6 +5,6 @@ Title - +

404?

\ No newline at end of file diff --git a/src/HTML/39.html b/web/HTML/regist_success.html similarity index 74% rename from src/HTML/39.html rename to web/HTML/regist_success.html index 566549b..adc5d9e 100644 --- a/src/HTML/39.html +++ b/web/HTML/regist_success.html @@ -5,6 +5,6 @@ Title - +

注册成功

\ No newline at end of file diff --git a/web/JSP/hello.jsp b/web/JSP/hello.jsp new file mode 100644 index 0000000..3950455 --- /dev/null +++ b/web/JSP/hello.jsp @@ -0,0 +1,29 @@ +<%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/6/27 + Time: 10:09 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +application:<%=application.getAttribute("name1")%>
+session:<%=session.getAttribute("name2")%>
+request:<%=request.getAttribute("name3")%>
+pageContext:<%=pageContext.getAttribute("name4")%>
+这是我的第一个jsp页面 +
+<% + for(int i=0;i<=100;i+=2){ +%> +
<%=i%>; +<%!int i=1;%> +<% + } +%> + + diff --git a/web/JSP/include.jsp b/web/JSP/include.jsp new file mode 100644 index 0000000..9935ebb --- /dev/null +++ b/web/JSP/include.jsp @@ -0,0 +1,17 @@ +<%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/6/27 + Time: 10:46 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + include + + +

wo

+<%@ include file="hello.jsp"%> + + diff --git a/web/JSP/objectDemo.jsp b/web/JSP/objectDemo.jsp new file mode 100644 index 0000000..59cdd3d --- /dev/null +++ b/web/JSP/objectDemo.jsp @@ -0,0 +1,26 @@ +<%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/6/27 + Time: 11:58 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<% application.setAttribute("name1","安安"); + session.setAttribute("name2","呃呃"); + request.setAttribute("name3","喔喔"); + pageContext.setAttribute("name4","翻翻"); +%> +application:<%=application.getAttribute("name1")%>
+session:<%=session.getAttribute("name2")%>
+request:<%=request.getAttribute("name3")%>
+pageContext:<%=pageContext.getAttribute("name4")%>
+<%----%> +Demo2 + + diff --git a/web/Session/re_login.jsp b/web/Session/re_login.jsp new file mode 100644 index 0000000..193f890 --- /dev/null +++ b/web/Session/re_login.jsp @@ -0,0 +1,36 @@ +<%@ page import="java.util.UUID" %><%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/6/29 + Time: 11:42 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +<% + String uuid = UUID.randomUUID().toString().replace("-", ""); + session.setAttribute("uuid",uuid); +%> +
+ + + + + + + + + + + + + +
用户名:
密码:
+
+ + + diff --git a/web/Session/sessionDemo.jsp b/web/Session/sessionDemo.jsp new file mode 100644 index 0000000..810eccb --- /dev/null +++ b/web/Session/sessionDemo.jsp @@ -0,0 +1,20 @@ +<%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/6/29 + Time: 10:15 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + +sessionID:<%=session.getId()%>
+获取Session +持久化Session +设置Session立即失效 +name:<%=session.getAttribute("stu")%> + + diff --git a/web/WEB-INF/lib/commons-fileupload-1.4.jar b/web/WEB-INF/lib/commons-fileupload-1.4.jar new file mode 100644 index 0000000..e25a6bc Binary files /dev/null and b/web/WEB-INF/lib/commons-fileupload-1.4.jar differ diff --git a/web/WEB-INF/lib/commons-io-2.7.jar b/web/WEB-INF/lib/commons-io-2.7.jar new file mode 100644 index 0000000..5889458 Binary files /dev/null and b/web/WEB-INF/lib/commons-io-2.7.jar differ diff --git a/web/WEB-INF/lib/gson-2.8.5.jar b/web/WEB-INF/lib/gson-2.8.5.jar new file mode 100644 index 0000000..0d5baf3 Binary files /dev/null and b/web/WEB-INF/lib/gson-2.8.5.jar differ diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml new file mode 100644 index 0000000..05a64ac --- /dev/null +++ b/web/WEB-INF/web.xml @@ -0,0 +1,245 @@ + + + + Listener.ApplicationlistenerDemo + + + + age + 18 + + + HelloServlet + Servlet.HelloServlet + + encode + UTF-8 + + + + HelloServlet + /HelloServlet + + + + MyServlet + Servlet.MyServlet + + encode + UTF-8 + + + + MyServlet + /MyServlet + + + + LoginServlet + Servlet.LoginServlet + + encode + UTF-8 + + + + LoginServlet + /LoginServlet + + + + RegistServlet + Servlet.RegistServlet + + encode + UTF-8 + + + + RegistServlet + /RegistServlet + + + + CreateCookieServlet + Servlet.CreateCookieServlet + + encode + UTF-8 + + + + CreateCookieServlet + /CreateCookieServlet + + + + + GetCookieServlet + Servlet.GetCookieServlet + + encode + UTF-8 + + + + GetCookieServlet + /GetCookieServlet + + + + UpdateCookieServlet + Servlet.UpdateCookieServlet + + encode + UTF-8 + + + + UpdateCookieServlet + /UpdateCookieServlet + + + + KeepCookieServlet + Servlet.KeepCookieServlet + + encode + UTF-8 + + + + KeepCookieServlet + /KeepCookieServlet + + + + UserCookieServlet + Servlet.UserCookieServlet + + encode + UTF-8 + + + + UserCookieServlet + /UserCookieServlet + + + + GetSessionServlet + Servlet.GetSessionServlet + + encode + UTF-8 + + + + GetSessionServlet + /GetSessionServlet + + + + KeepSessionServlet + Servlet.KeepSessionServlet + + encode + UTF-8 + + + + KeepSessionServlet + /KeepSessionServlet + + + + RemoveSessionServlet + Servlet.RemoveSessionServlet + + encode + UTF-8 + + + + RemoveSessionServlet + /RemoveSessionServlet + + + + FormRepeatServlet + Servlet.FormRepeatServlet + + encode + UTF-8 + + + + FormRepeatServlet + /FormRepeatServlet + + + + + HelloWorldFilter + Filter.HelloWorldFilter + + + HelloWorldFilter + + /userServlet + + + + userServlet + Filter.userServlet + + + userServlet + /userServlet + + + + userServletFilter + Filter.userServletFilter + + + userServletFilter + /userServlet + + + + + + + + HttpFilterTest + Filter.HttpFilterTest + + + HttpFilterTest + + /HttpFilterTest + + + + CharSetFilter + Filter.CharSetFilter + + code + UTF-8 + + + + CharSetFilter + + /* + + + + \ No newline at end of file diff --git a/web/index.jsp b/web/index.jsp new file mode 100644 index 0000000..f14fda0 --- /dev/null +++ b/web/index.jsp @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: asus + Date: 2020/6/24 + Time: 17:18 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + $Title$ + + + hello + +