MVC_Board - index.jsp

모쿠모쿠·2022년 8월 22일

JSP

목록 보기
118/151
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script>
	function confirmLogout() {
    	if(confirm("로그아웃 하시겠습니까?")){ // 확인 : true, 취소 : false 리턴됨
        	// MemberLogout.me 포워딩
            location.href = "MemberLogout.me";
        }
    }
</script>
<title>Insert title here</title>
</head>
<body>
	<header>
    	<c:choose>
        	<c:when test="${empth sessionScope.sId }">
            	<a href="MemberLoginForm.me">로그인</a> | <a href="MemberJoinForm.me">회원가입</a>            
            </c:when>
            <c:otherwise>
            	<%-- 하이퍼링크에 자바스크립트 함수 연결 시 href 속성에 아무 경로도 지정하지 않는 방법 // # 을 해도 디지만 # 은 주소창에 보임 --%>
                ${sessionScope.sId } 님 | <a href="javascript:void(0)" onclick="confirmLogout()">로그아웃</a>
                <c:if test="${sessionScope.sId eq 'admin'}"><a href="AdminMain.me">| 관리자페이지</a></c:if>
            </c:otherwise>
        </c:choose>
    </header>
    <h1>MVC 게시판 프로젝트</h1>
    <h3><a href="BoardWriteForm.bo">글쓰기</h3>
    <h3><a href="BoardList.bo">글목록</h3>
</body>
</html>
            

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Insert title here 로그인 | 회원가입 <%-- 하이퍼링크에 자바스크립스 함수 연결 시 href 속성에 아무 경로도 지정하지 않는 방법 // # 을 해도 되지만 # 은 주소에 보임 --%> ${sessionScope.sId } 님 | 로그아웃 <%-- 세션 아이디가 "admin" 일 때만 관리자페이지 링크("AdminMain.me") 표시 --%> | 관리자페이지

MVC 게시판 프로젝트

글쓰기

글목록

profile
Hello, Velog!

0개의 댓글