Search

๋กœ๊ทธ์•„์›ƒ

๋กœ๊ทธ์•„์›ƒ

โ€ข
๊ธฐ๋Šฅ ์„ค๋ช…
โ€ข
์ž‘์—… ์ˆœ์„œ
โ€ข
์‹ค์Šต ์ฝ”๋“œ
โ€ข
ํ…Œ์ŠคํŠธ
โ€ข
๊ฒฐ๊ณผ ํ™”๋ฉด

๊ธฐ๋Šฅ ์„ค๋ช…

๋กœ๊ทธ์•„์›ƒ ๊ธฐ๋Šฅ์€ ์„ธ์…˜์˜ ๋“ฑ๋ก๋œ ์‚ฌ์šฉ์ž ์ •๋ณด๋ฅผ ํ•ด์ œํ•˜๋Š” ๊ธฐ๋Šฅ์ž…๋‹ˆ๋‹ค.

์ž‘์—… ์ˆœ์„œ

1.
๋กœ๊ทธ์•„์›ƒ ๋ฒ„ํŠผ ์ž‘์„ฑ
2.
๋กœ๊ทธ์•„์›ƒ ์ฒ˜๋ฆฌ ๋กœ์ง ์ž‘์„ฑ

๋กœ๊ทธ์•„์›ƒ ๋ฒ„ํŠผ ์ž‘์„ฑ

๋กœ๊ทธ์ธ ์‹œ, ์ถœ๋ ฅ๋˜๋Š” ํ™”๋ฉด์—์„œ ๋กœ๊ทธ์•„์›ƒ ๋ฒ„ํŠผ์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
์ผ๋ฐ˜์ ์œผ๋กœ, ๋กœ๊ทธ์ธ ์‹œ ์ถœ๋ ฅ๋˜๋Š” UI ์ธ ํ—ค๋” ์˜์—ญ์— ๋กœ๊ทธ์•„์›ƒ ๋ฒ„ํŠผ์„ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

๋กœ๊ทธ์•„์›ƒ ์ฒ˜๋ฆฌ ๋กœ์ง ์ž‘์„ฑ

์„ธ์…˜์„ ๋น„ํ™œ์„ฑํ™”ํ•˜๊ณ  ๋กœ๊ทธ์ธ ๊ด€๋ จ ์‚ฌ์šฉ์ž ์ฟ ํ‚ค ๋“ฑ์„ ์ œ๊ฑฐํ•˜๋Š” ๋กœ์ง์„ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.

์‹ค์Šต ์ฝ”๋“œ

โ€ข
header.jsp - ๋กœ๊ทธ์•„์›ƒ ๋ฒ„ํŠผ
โ€ข
logout.jsp - ๋กœ๊ทธ์•„์›ƒ ์ฒ˜๋ฆฌ ๋กœ์ง

header.jsp - ๋กœ๊ทธ์•„์›ƒ ๋ฒ„ํŠผ

<!-- ๋กœ๊ทธ์ธ ์‹œ --> <li class="nav-item"> <div class="dropdown text-white"> <a href="#" class="d-flex align-items-center link-body-emphasis text-decoration-none dropdown-toggle text-white" data-bs-toggle="dropdown" aria-expanded="false"> <img src="<%= root %>/static/img/logo.png" alt="" width="32" height="32" class="rounded-circle me-2"> <strong class="text-white"><%= loginId %></strong> </a> <ul class="dropdown-menu text-small shadow"> <li><a class="dropdown-item" href="${ root }/users/logout.jsp">๋กœ๊ทธ์•„์›ƒ</a></li> </ul> </div> </li>
HTML
๋ณต์‚ฌ

logout.jsp - ๋กœ๊ทธ์•„์›ƒ ์ฒ˜๋ฆฌ ๋กœ์ง

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% // ์„ธ์…˜ ๋ฌดํšจํ™” session.invalidate(); // ๋ฉ”์ธ ํ™”๋ฉด์œผ๋กœ ์ด๋™ response.sendRedirect(request.getContextPath() + "/"); %>
Java
๋ณต์‚ฌ

ํ…Œ์ŠคํŠธ

๊ฒฐ๊ณผ ํ™”๋ฉด