diff --git a/.idea/artifacts/learn02_war_exploded.xml b/.idea/artifacts/learn02_war_exploded.xml new file mode 100644 index 0000000..e86e692 --- /dev/null +++ b/.idea/artifacts/learn02_war_exploded.xml @@ -0,0 +1,13 @@ + + + $PROJECT_DIR$/out/artifacts/learn02_war_exploded + + + + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/learn02_war_exploded2.xml b/.idea/artifacts/learn02_war_exploded2.xml new file mode 100644 index 0000000..dce5a39 --- /dev/null +++ b/.idea/artifacts/learn02_war_exploded2.xml @@ -0,0 +1,20 @@ + + + $PROJECT_DIR$/out/artifacts/learn02_war_exploded2 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index dbb6ff9..d399fe2 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -3,6 +3,7 @@ + diff --git a/learn02/learn02.iml b/learn02/learn02.iml new file mode 100644 index 0000000..abfa2d4 --- /dev/null +++ b/learn02/learn02.iml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/learn02/web/WEB-INF/web.xml b/learn02/web/WEB-INF/web.xml new file mode 100644 index 0000000..0bf2fcb --- /dev/null +++ b/learn02/web/WEB-INF/web.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/learn02/web/index.jsp b/learn02/web/index.jsp new file mode 100644 index 0000000..09faf70 --- /dev/null +++ b/learn02/web/index.jsp @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: awinx + Date: 2024/12/5 + Time: ÏÂÎç1:31 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + $Title$ + + + $END$ + + diff --git a/learn1/src/login/UserLoginAction.java b/learn1/src/login/UserLoginAction.java index 562555b..7caf6ff 100644 --- a/learn1/src/login/UserLoginAction.java +++ b/learn1/src/login/UserLoginAction.java @@ -18,17 +18,15 @@ public class UserLoginAction extends HttpServlet { } String username = req.getParameter("username"); String password = req.getParameter("password"); - int flag; UserInfo user = UserDB.GetUserInfoByName(username); if(user == null) { - flag = 1; + response.sendRedirect(path+"/login/login.jsp&loginflag=1"); }else if (user.getPass().equals(password)) { - flag=0; req.getSession().setAttribute("user", user); + response.sendRedirect(path+"/home.jsp"); }else{ - flag=2; + response.sendRedirect(path+"/login/login.jsp&loginflag=2"); } - System.out.println(user); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.sendRedirect("error.jsp"); diff --git a/learn1/web/course/course.jsp b/learn1/web/course/course.jsp index 465510d..874321c 100644 --- a/learn1/web/course/course.jsp +++ b/learn1/web/course/course.jsp @@ -11,7 +11,8 @@ 课程信æ¯åˆ—表 - + +
diff --git a/learn1/web/css/common.css b/learn1/web/css/common.css new file mode 100644 index 0000000..79935bb --- /dev/null +++ b/learn1/web/css/common.css @@ -0,0 +1,62 @@ +.container{ + background-color: white; + position: relative; + margin: auto; + width: 80%; +} + +body{ + background-color: white; +} + +a{ + text-decoration: none; + color: white; + font-weight: bold; +} + +table{ + width:100%; + border-spacing: 0; + background-color: #c4c4c4; +} + +tr{ + height: 25px; + padding: 2px; +} + +.tr-head{ + background-color: #2bf; + text-align: center; +} + +tr:nth-child(odd){ + background:#F4F4F4; +} + +button,.button{ + background-color: #39f; + border: #39f solid 1px; + border-radius: 5px; + color: white; + padding: 5px; + line-height: 100%; + text-align: center; + margin: 5px; +} + +.red { + COLOR: red +} + +.blue { + color: blue; +} + +.underline { + BORDER-BOTTOM: #c4c4c4 1pt solid; + BORDER-LEFT: #c4c4c4; + BORDER-RIGHT: #c4c4c4; + BORDER-TOP: #c4c4c4; +} \ No newline at end of file diff --git a/learn1/web/css/course.css b/learn1/web/css/course.css index 58dd320..1f0b3d8 100644 --- a/learn1/web/css/course.css +++ b/learn1/web/css/course.css @@ -1,57 +1,3 @@ - -tr:nth-child(odd){ - background:#F4F4F4; -} - -.tr-head{ - background-color: #2bf; - text-align: center; -} - -table{ - width:100%; - border-spacing: 0; -} - -.td1 { - BACKGROUND-COLOR: #e6e6e6 -} -.td_header { - BACKGROUND-COLOR: #e6e6e6; COLOR: #000000 -} -.td_1 { - BACKGROUND-COLOR: #f8fbfb; COLOR: #000000 -} -.td_2 { - BACKGROUND-COLOR: #deecec; COLOR: #000000 -} -.td3 { - BACKGROUND-COLOR: #a3d1d2; COLOR: black -} -.underline { - BORDER-BOTTOM: #c4c4c4 1pt solid; BORDER-LEFT: #c4c4c4; BORDER-RIGHT: #c4c4c4; BORDER-TOP: #c4c4c4 -} -.button { - border:1px solid black; - background-color:white; - cursor:hand; -} -.star { - COLOR: red -} -.tb_showall -{ - background:#0078B7; - font-size: 18px; - font-weight: bold; -} -.container{ - margin: auto; - width: 80%; - text-align: center; - align-items: center; - position: relative; -} .input-form{ border: black solid 1px; margin: auto; diff --git a/learn1/web/css/index.css b/learn1/web/css/index.css index c3fbe8d..b934235 100644 --- a/learn1/web/css/index.css +++ b/learn1/web/css/index.css @@ -1,4 +1,4 @@ -.nav-list{ +.nav-area{ position: absolute; top: 0; left: 0; @@ -8,13 +8,34 @@ margin: 0; padding: 5px; } + +.nav-list{ + padding-left: 0; + padding-right: 5px; +} + +.nav-item{ + list-style: none; + line-height: 100%; + text-align: center; + font-size: 19px; + margin: 5px 0; + padding: 3px 0; + color: white; + a{ + text-decoration: none; + color: white; + font-weight: bold; + } +} + .content{ position: absolute; top: 0; right: 0; background-color: #eee; height: 95%; - width: 80%; + width: 79%; margin: 0; padding: 5px; } \ No newline at end of file diff --git a/learn1/web/css/login.css b/learn1/web/css/login.css new file mode 100644 index 0000000..592ef0e --- /dev/null +++ b/learn1/web/css/login.css @@ -0,0 +1,15 @@ +.login-card{ + width: 80%; + border: #eee solid 2px; + border-radius: 5px; +} +input{ + width: 75%; + height: 35px; + border: grey solid 2px; + border-radius: 5px; + margin: 5px; + padding: 5px; + line-height: 100%; + text-align: center; +} diff --git a/learn1/web/home.jsp b/learn1/web/home.jsp index 7cf6909..e2a078e 100644 --- a/learn1/web/home.jsp +++ b/learn1/web/home.jsp @@ -9,15 +9,17 @@ 主页 +

学生信æ¯ç®¡ç†ç³»ç»Ÿ

+ <% if(session.getAttribute("user")==null){ - out.println("登录"); + out.println(""); }else{ - out.println("注销"); + out.println(""); } %>
diff --git a/learn1/web/index.jsp b/learn1/web/index.jsp index 1524bce..8cc0dc3 100644 --- a/learn1/web/index.jsp +++ b/learn1/web/index.jsp @@ -10,12 +10,13 @@ 学生信æ¯ç®¡ç†ç³»ç»Ÿ + -