JSP

jstl 다운로드 

http://www.java2s.com/Code/Jar/j/Downloadjstl12jar.htm

 

 

_top.jspf

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>	    
    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="/">지속가능한 삶, 프로그래밍, 프로그래머</a>
          <div class="nav-collapse collapse">

            <ul class="nav">
              <li><a href="/">Home</a></li>
              <li><a href="/imgpop.jsp">이미지</a></li>
              <li><a href="/xmlparsing.jsp">xml</a></li>
              
            <c:choose>
            	<c:when test="${empty sessionScope.userId }">
          		        <li><a href="/login.jsp">로그인</a></li>
          				 <li><a href="/form.jsp">회원가입</a></li>
            	</c:when>
            	<c:otherwise>
		              <li><a href="/users/logout">로그아웃</a></li>
		              <li><a href="">개인정보수정</a></li>
            	
            	</c:otherwise>
            </c:choose>  

            </ul>
          </div>
        </div>
      </div>
    </div>
  

 

 

login.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/commons/_head.jspf" %>
<body>
<%@ include file="/commons/_top.jspf" %>


	<div class="container">
		<div class="row">
			<div class="span12">
				<section id="typography">
				<div class="page-header">
					<h1>로그인</h1>
				</div>
				
				<form class="form-horizontal" action="/users/login" method="post">
					<c:if test="${not empty errorMessage}">
					<div class="control-group">
						<label class="error">${errorMessage}</label>
					</div>
					</c:if>
					
					<div class="control-group">
						<label class="control-label" for="userId">사용자 아이디</label>
						<div class="controls">
							<input type="text" name="userId" value="" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="password">비밀번호</label>
						<div class="controls">
							<input type="password" id="password" name="password" placeholder="">
						</div>
					</div>
					<div class="control-group">
						<div class="controls">
							<button type="submit" class="btn btn-primary">로그인</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</body>
</html>

 

 

 

 

 

jsp

 

about author

PHRASE

Level 60  머나먼나라

남을 이해하고 용서하는 것은 자기를 이해할 줄 알고 높은 인격을 가진 사람이 아니면 할 수 없다. - D. 카네기

댓글 ( 4)

댓글 남기기

작성