String id=(String)session.getAttribute("id");
<%=id%>
(==)
${sessionScope.id}
JSP 표준 태그 함수
프로그램 설치 tomcat.apache.org
다운받아서
lib 폴더에 넣어주기
상단에 입력, 가져와서 사용
변수선언
<c:set>
조건
<c:if>, <c:choose>, <c:when> <c:otherwise>
반복문
<c:forEach>, <c:forTokens>
이동
<c:redirect>, <c:url>, <c:import>, <c:param>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
=> 포맷 가져와서 사용할 때
날짜 포맷 <fmt:formatDate>, 숫자포맷 <fmt:formatNumber>, 한글 <fmt:requestEncoding>
<c:if test="${! empty sessionScope.id}">
<div id="login"><%=id %> => ${sessionScope.id} 님 |
<a href="MemberLogout.me">logout</a> |
<a href="MemberUpdateForm.me">update</a></div>
</c:if>
<c:if test="${empty sessionScope.id}">
<div id="login"><a href="MemberLoginForm.me">login</a> |
<a href="MemberInsertForm.me">join</a></div>
</c:if>
<table id="notice">
<tr><th class="tno">No.</th>
<th class="ttitle">Title</th>
<th class="twrite">Writer</th>
<th class="tdate">Date</th>
<th class="tread">Read</th></tr>
<c:forEach var="dto" items="${boardList}">
<tr onclick="location.href='BoardContent.bo?num=${dto.num}'"><td>${dto.num}</td>
<td class="left">
<c:if test="${dto.re_lev > 0}">
<c:set var="wid" value="${dto.re_lev*10}"></c:set>
<img src="images/center/level.gif" width="${wid}" height="15">
<img src="images/center/re.gif">
</c:if>
${dto.subject}</td>
<td>${dto.name}</td>
<td><fmt:formatDate value="${dto.date}" pattern="yyyy.MM.dd"/> </td>
<td>${dto.readcount}</td></tr>
</c:forEach>
</table>