JSP

 

 

Header.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
  <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="http://bootstrapk.com/examples/carousel/favicon.ico">

    <title>Carousel Template for Bootstrap</title>

       <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="css/carousel.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
<style>
@media screen and (min-width: 768px){

 #slideLeft{
 
    position: absolute;
    top: 50%;
    z-index: 5;
    display: inline-block;
 
    width: 30px;
    height: 30px;
    margin-top: -15px;
    font-size: 30px;
}

#slideRight{
	position: absolute;
    top: 50%;
    z-index: 5;
    display: inline-block;
    
    width: 30px;
    height: 30px;
    margin-top: -15px;
    font-size: 30px;
}
</style>
    
    

   

 

Top.jsp

<%@page import="db.RentcarDAO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!--  세션을 이용한 로그인 처리 -->
<%
	String id =(String)session.getAttribute("id");

	//로그인이 되어있지 않다면, 
	if(id==null){
		id="GUEST";
	}
%>
   
 <div class="navbar-wrapper">
      <div class="container">

        <nav class="navbar navbar-inverse navbar-static-top">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Macaronics</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              <a class="navbar-brand" href="#">SM 렌트카</a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
              <ul class="nav navbar-nav">
                <li class="active"><a href="#">예약하기</a></li>
                <li><a href="#about">예약확인</a></li>
                <li><a href="#contact">자유게시판</a></li>
                <li><a href="#contact">이벤트</a></li>
                <li><a href="#contact">고객센터</a></li>
				<li><a href="#"><%= id %>님 반갑습니다.</a></li>

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

      </div>
    </div>
    
    

 

Center.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
   <!-- Carousel
    ================================================== -->
    <div id="myCarousel" class="carousel slide" data-ride="carousel">
      <!-- Indicators -->
      <ol class="carousel-indicators">
        <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
        <li data-target="#myCarousel" data-slide-to="1"></li>
        <li data-target="#myCarousel" data-slide-to="2"></li>
      </ol>
      <div class="carousel-inner" role="listbox">
        <div class="item active">
          <img class="first-slide" src="img/1.jpg" alt="First slide">
          <div class="container">
            <div class="carousel-caption">
              <h1>Example headline.</h1>
              <p>Note: If you're viewing this page via a <code>file://</code> URL, the "next" and "previous" Glyphicon buttons on the left and right might not load/display properly due to web browser security rules.</p>
              <p><a class="btn btn-lg btn-primary" href="#" role="button">Sign up today</a></p>
            </div>
          </div>
        </div>
        <div class="item">
          <img class="second-slide" src="img/2.jpg" alt="Second slide">
          <div class="container">
            <div class="carousel-caption">
              <h1>Another example headline.</h1>
              <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
              <p><a class="btn btn-lg btn-primary" href="#" role="button">Learn more</a></p>
            </div>
          </div>
        </div>
        <div class="item">
          <img class="third-slide" src="img/3.jpg" alt="Third slide">
          <div class="container">
            <div class="carousel-caption">
              <h1>One more for good measure.</h1>
              <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
              <p><a class="btn btn-lg btn-primary" href="#" role="button">Browse gallery</a></p>
            </div>
          </div>
        </div>
      </div>
      <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
        <span id="slideLeft"><< </span>
        <span class="sr-only">Previous</span>
      </a>
      <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
        <span id="slideRight">>></span>
        <span class="sr-only">Next</span>
      </a>
    </div><!-- /.carousel -->

 

RentCarMain.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
  <head>
<jsp:include page="Header.jsp" />
  </head>
 <body>
  <!-- top 메뉴 -->
<jsp:include page="Top.jsp" />

<%
	String center =request.getParameter("Center");
	//처음 실행시에는 center 값이 넘어오지 않기에
	if(center==null){//null 처리해줌
		center="Center.jsp";//디폴트 cetner 값을 부여
	}
%>

<jsp:include page="<%= center %>" />
 
 
<!--  Bottom -->
 <jsp:include page="Bottom.jsp"/>
 
 
 

 

Bottom.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>


</div><!-- /.container -->
     
     <!-- FOOTER -->
<nav class="avbar navbar-inverse navbar-fixed-bottom">
  <div class="container text-center" style="color:#fff;">
   <ul style=" list-style:none;">
   		<li><h5>주소 : <a href="http://macaronics.net" >macaronics.net</a></h5></li>
   </ul>
  </div>
</nav>
  

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script src="http://bootstrapk.com/dist/js/bootstrap.min.js"></script>
    <!-- Just to make our placeholder images work. Don't actually copy the next line! -->
    <script src="http://bootstrapk.com/assets/js/vendor/holder.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="http://bootstrapk.com/assets/js/ie10-viewport-bug-workaround.js"></script>
  </body>
</html>

 

 

 

동영상 강좌와 다르게  모바일 적용이 가능한 반응형 부트스트랩을 사용하였다.

여기서는  jsp 를 배우는 강좌 이기 때문에 html 적 요소에는 비중있게 생각 하지 않아도 될 것이다.

 

또한, 일부 자바 코드는 제 입맛에 맞게 변경 하였습니다.

혹시, 이 강의를 들으면서 제 글을 읽고 소스코드를 참조하는 수강생이 있다면 동영상의 코드와 다르다고 생각지 마세요. 대부분 동여상 내용과 같으니 학습에 도움이 될거라 생각 합니다.

소스 :  https://github.com/braverokmc79/jsp_sin

 

 

유튜브 동영상 출처 :

소프트캠퍼스

강사 : 신형섭(잭임연구원)

저작권 : (주)소프트캠퍼스 http://www.softcampus.co.kr 더많은 무료 강의는 사이트에서 확인하실수 있습니다.

 

 

 

about author

PHRASE

Level 60  라이트

남을 따르는 법을 알지 못하는 사람은 좋은 지도자가 될 수 없다. -아리스토텔레스

댓글 ( 4)

댓글 남기기

작성