From d48fe83d4fc4c402e8bdc0bf829ef417cd7d8981 Mon Sep 17 00:00:00 2001 From: SeoJin Kim Date: Thu, 28 Jan 2021 09:01:56 +0900 Subject: [PATCH] =?UTF-8?q?[Spring][=EC=87=BC=ED=95=91=EB=AA=B0=20?= =?UTF-8?q?=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8][10]=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83=20=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84(?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=ED=8E=98=EC=9D=B4=EC=A7=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://kimvampa.tistory.com/135 --- .../com/vam/controller/MemberController.java | 15 +++++++++++++++ VamPa/src/main/webapp/WEB-INF/views/main.jsp | 1 + VamPa/src/main/webapp/resources/css/main.css | 12 ++++++++++++ .../maven/com.vam/controller/pom.properties | 2 +- .../com/vam/controller/MemberController.java | 16 ++++++++++++++++ .../src/main/webapp/WEB-INF/views/main.jsp | 1 + .../src/main/webapp/resources/css/main.css | 12 ++++++++++++ .../maven/com.vam/controller/pom.properties | 2 +- 8 files changed, 59 insertions(+), 2 deletions(-) diff --git a/VamPa/src/main/java/com/vam/controller/MemberController.java b/VamPa/src/main/java/com/vam/controller/MemberController.java index 53ee39c..6a84b49 100644 --- a/VamPa/src/main/java/com/vam/controller/MemberController.java +++ b/VamPa/src/main/java/com/vam/controller/MemberController.java @@ -179,6 +179,21 @@ public class MemberController { } + /* 메인페이지 로그아웃 */ + @RequestMapping(value="logout.do", method=RequestMethod.GET) + public String logoutMainGET(HttpServletRequest request) throws Exception{ + + logger.info("logoutMainGET메서드 진입"); + + HttpSession session = request.getSession(); + + session.invalidate(); + + return "redirect:/main"; + + } + + } diff --git a/VamPa/src/main/webapp/WEB-INF/views/main.jsp b/VamPa/src/main/webapp/WEB-INF/views/main.jsp index 3c5e912..62f46c4 100644 --- a/VamPa/src/main/webapp/WEB-INF/views/main.jsp +++ b/VamPa/src/main/webapp/WEB-INF/views/main.jsp @@ -37,6 +37,7 @@ 회원 : ${member.memberName} 충전금액 : 포인트 : + 로그아웃 diff --git a/VamPa/src/main/webapp/resources/css/main.css b/VamPa/src/main/webapp/resources/css/main.css index 8c2cdec..a9263bf 100644 --- a/VamPa/src/main/webapp/resources/css/main.css +++ b/VamPa/src/main/webapp/resources/css/main.css @@ -89,6 +89,18 @@ margin: 5% auto; padding-top: 5%; } +.login_success_area>a{ + font-size: 15px; + font-weight: 900; + display: inline-block; + margin-top: 5px; + background: #e1e5e8; + width: 82px; + height: 22px; + line-height: 22px; + border-radius: 25px; + color: #606267; +} .login_success_area>span{ display : block; text-align: left; diff --git a/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties b/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties index 353c6b0..cda9d83 100644 --- a/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties +++ b/VamPa/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven Integration for Eclipse -#Wed Jan 20 18:37:06 KST 2021 +#Thu Jan 28 07:55:32 KST 2021 m2e.projectLocation=C\:\\Users\\sjinj\\git\\Blog_Project\\VamPa m2e.projectName=VamPa groupId=com.vam diff --git a/VamPa_MySQL/src/main/java/com/vam/controller/MemberController.java b/VamPa_MySQL/src/main/java/com/vam/controller/MemberController.java index a8712f7..683994b 100644 --- a/VamPa_MySQL/src/main/java/com/vam/controller/MemberController.java +++ b/VamPa_MySQL/src/main/java/com/vam/controller/MemberController.java @@ -178,4 +178,20 @@ public class MemberController { } + + /* 메인페이지 로그아웃 */ + @RequestMapping(value="logout.do", method=RequestMethod.GET) + public String logoutMainGET(HttpServletRequest request) throws Exception{ + + logger.info("logoutMainGET메서드 진입"); + + HttpSession session = request.getSession(); + + session.invalidate(); + + return "redirect:/main"; + + } + + } diff --git a/VamPa_MySQL/src/main/webapp/WEB-INF/views/main.jsp b/VamPa_MySQL/src/main/webapp/WEB-INF/views/main.jsp index 3c5e912..62f46c4 100644 --- a/VamPa_MySQL/src/main/webapp/WEB-INF/views/main.jsp +++ b/VamPa_MySQL/src/main/webapp/WEB-INF/views/main.jsp @@ -37,6 +37,7 @@ 회원 : ${member.memberName} 충전금액 : 포인트 : + 로그아웃 diff --git a/VamPa_MySQL/src/main/webapp/resources/css/main.css b/VamPa_MySQL/src/main/webapp/resources/css/main.css index 8c2cdec..a9263bf 100644 --- a/VamPa_MySQL/src/main/webapp/resources/css/main.css +++ b/VamPa_MySQL/src/main/webapp/resources/css/main.css @@ -89,6 +89,18 @@ margin: 5% auto; padding-top: 5%; } +.login_success_area>a{ + font-size: 15px; + font-weight: 900; + display: inline-block; + margin-top: 5px; + background: #e1e5e8; + width: 82px; + height: 22px; + line-height: 22px; + border-radius: 25px; + color: #606267; +} .login_success_area>span{ display : block; text-align: left; diff --git a/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties b/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties index 38ac48c..634b847 100644 --- a/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties +++ b/VamPa_MySQL/target/m2e-wtp/web-resources/META-INF/maven/com.vam/controller/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven Integration for Eclipse -#Wed Jan 20 19:32:05 KST 2021 +#Thu Jan 28 08:32:01 KST 2021 m2e.projectLocation=C\:\\Users\\sjinj\\git\\Blog_Project\\VamPa_MySQL m2e.projectName=VamPa_MySQL groupId=com.vam