JSP λ μ΄μμ ꡬμ±νκΈ°
β’
νλ‘μ νΈ κ΅¬μ‘°
β’
μ μ νμΌ μ€λΉνκΈ°
β’
λΌμ΄λΈλ¬λ¦¬ μ€λΉνκΈ°
β’
μμ νμΌ μ€λΉνκΈ°
β¦
jstl.jsp
β¦
common.jsp
β¦
header.jsp
β¦
footer.jsp
β¦
meta.jsp
β¦
link.jsp
β¦
script.jsp
β’
λ©μΈ νλ©΄ λ§λ€κΈ°
β¦
index.jsp
β¦
μμ νμΌ ν¬ν¨νκΈ°
βͺ
μ‘μ
νκ·Έ <jsp:include>
νλ‘μ νΈ κ΅¬μ‘°
π¦ project
βββ π src
βββ π main
βββ π java
β βββ π filter
β βββ π EncodingFilter.java
βββ π webapp
βββ π WEB-INF
β βββ π lib
β βββ π lombok.jar
β βββ π mysql-connector-j-9.0.0.jar
β βββ π taglibs-standard-compat-1.2.5.jar
β βββ π taglibs-standard-impl-1.2.5.jar
β βββ π taglibs-standard-jstlel-1.2.5.jar
β βββ π taglibs-standard-spec-1.2.5.jar
β βββ π jbcrypt-0.4.jar
β βββ π alcl-jdbc.jar
βββ π static
β βββ π css
β β βββ π reset.css
β β βββ π style.css
β βββ π img
β β βββ π logo.png
β βββ π js
β βββ π script.js
βββ π layout
βββ π jstl.jsp
βββ π header.jsp
βββ π footer.jsp
βββ π meta.jsp
βββ π link.jsp
βββ π script.jsp
βββ π common.jsp
βββ π index.jsp
Plain Text
볡μ¬
μ μ νμΌ μ€λΉνκΈ°
...
βββ π webapp
βββ π static
β βββ π css
β β βββ π reset.css
β β βββ π style.css
β βββ π img
β β βββ π logo.png
β βββ π js
β βββ π script.js
...
Plain Text
볡μ¬
β’
css
β¦
reset.css
β¦
style.css
β’
img
β¦
logo.png
β’
js
β¦
script.js
reset.css
@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR&display=swap');
/*reset*/
* {margin: 0; padding: 0; box-sizing: border-box; }
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, tbody, tfoot, thead, tr, th, td{margin:0;padding:0;}
h1, h2, h3, h4, h5, h6 {font-weight: 700; font-size: inherit;}
a {text-decoration: inherit; color: inherit;}
li {list-style: none;}
img {vertical-align: middle;}
a img {border: none;}
a:focus {outline: none}
button:focus {outline: none}
body {
font-family: 'Noto Sans KR', sans-serif;
}
/* κΈμ¨ λλκ·Έ μ, μνλ₯Ό μ§μ νλ μ νμ */
::selection {
background-color: var(--main-color);
color: white;
}
/* β CSS λ³μ μ μΈ */
/* --λ³μλͺ
: κ° */
/* β
μ¬μ© : var(--λ³μλͺ
) */
/* html μ΅μμ μμ μ ν (html μ νλ³΄λ€ λμ μ°μ μμ */
:root {
/* π©βπ¨ λ©μΈ μ»¬λ¬ */
--main-color : #DCE6FF;
/* π©βπ¨ μλΈ μ»¬λ¬ */
--sub-color: #89B1FF;
/* π©βπ¨ ν°νΈ μ¬μ΄μ¦ */
--text-title: 32px;
--text-normal: 16px;
/* π©βπ¨ 컨ν
μ΄λ μ¬μ΄μ¦ */
--container-size: 1200px;
--container-lg-size: 1400px;
}
CSS
볡μ¬
style.css
@charset "UTF-8";
.container,
header,
footer
{
width: var(--container-size);
margin: 0 auto;
}
section {
margin: 100px auto;
min-height: 300px;
}
.text-title {
font-size: 32px;
}
CSS
볡μ¬
logo.png
script.js
/**
*
*/
document.addEventListener("DOMContentLoaded", function() {
alert("Hello JSP~!");
})
JavaScript
볡μ¬
λΌμ΄λΈλ¬λ¦¬ μ€λΉνκΈ°
...
π webapp
βββ π WEB-INF
β βββ π lib
β βββ π lombok.jar
β βββ π mysql-connector-j-9.0.0.jar
β βββ π taglibs-standard-compat-1.2.5.jar
β βββ π taglibs-standard-impl-1.2.5.jar
β βββ π taglibs-standard-jstlel-1.2.5.jar
β βββ π taglibs-standard-spec-1.2.5.jar
β βββ π jbcrypt-0.4.jar
β βββ π alcl-jdbc.jar
...
Plain Text
볡μ¬
μμ νμΌ μ€λΉνκΈ°
β’
jstl.jsp
β’
common.jsp
β’
header.jsp
β’
footer.jsp
β’
meta.jsp
β’
link.jsp
β’
script.jsp
jstl.jsp
<%-- JSTL --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
Java
볡μ¬
common.jsp
<%-- μ μλ³μ --%>
<%
// Context Path (λ£¨νΈ κ²½λ‘)
String root = request.getContextPath();
// λ‘κ·ΈμΈ μμ΄λ (μΈμ
)
String loginId = (String) session.getAttribute("loginId");
%>
Java
볡μ¬
header.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="/layout/common.jsp" %>
<header>
<img src="<%= root %>/static/img/logo.png" width="48" >
<nav>
<ul>
<li><a href="<%= root %>/login.jsp">λ‘κ·ΈμΈ</a></li>
<li><a href="<%= root %>/signup.jsp">νμκ°μ
</a></li>
</ul>
</nav>
</header>
HTML
볡μ¬
footer.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="/layout/common.jsp" %>
<footer>
<p>Copyright ALOHA CLASS</p>
</footer>
HTML
볡μ¬
meta.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="/layout/common.jsp" %>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <title>projectπ» - ALOHA CLASSπ΄</title> -->
<!-- νλΉμ½ -->
<link rel="icon" href="<%= root %>/static/img/logo.png" type="image/x-icon">
<!-- μΈλ€μΌ μ΄λ―Έμ§ μ€μ -->
<meta property="og:image" content="https://i.imgur.com/yiTQ3EV.jpg">
<!-- μΉ νμ΄μ§ μ€λͺ
(μ ν μ¬ν) -->
<meta property="og:description" content="ALOHA CLASSπ΄ - μΌνλͺ° νλ‘μ νΈ">
<!-- μΉ νμ΄μ§ URL -->
<meta property="og:url" content="<%= root %>">
<!-- μΉ νμ΄μ§ μ λͺ© -->
<meta name="title" content="projectπ» - ALOHA CLASSπ΄">
<meta property="og:title" content="projectπ» - ALOHA CLASSπ΄">
<!-- μΉ νμ΄μ§ νμ
(μΉμ¬μ΄νΈ, κΈ°μ¬, μ ν λ±) -->
<meta property="og:type" content="website">
<!-- κ²μμ΄ -->
<meta name="keywords" content="μΌνλͺ° νλ‘μ νΈ, μλ° μΉκ°λ°, ALOHA CLASS, μλ‘ν ν΄λμ€">
<meta name="robots" content="index, follow">
<!-- μ¬μ΄νΈ 맡 -->
<link rel="sitemap" href="<%= root %>/static/sitemap.xml">
HTML
볡μ¬
link.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="/layout/common.jsp" %>
<%-- ν°νΈ --%>
<%-- λΌμ΄λΈλ¬λ¦¬ --%>
<link href="<%= root %>/static/css/reset.css" rel="stylesheet" />
<link href="<%= root %>/static/css/style.css" rel="stylesheet" />
HTML
볡μ¬
script.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ include file="/layout/common.jsp" %>
<%-- λΌμ΄λΈλ¬λ¦¬ --%>
<%-- jQuery --%>
<script src="<%= root %>/static/js/script.js"></script>
HTML
볡μ¬
λ©μΈ νλ©΄ λ§λ€κΈ°
β’
index.jsp
β’
μμ νμΌ ν¬ν¨νκΈ°
β¦
λλ ν°λΈ νκ·Έ <%@ include %>
β¦
μ‘μ
νκ·Έ <jsp:include>
β’
λ μ΄μμ μμ±
index.jsp
<%@ include file="/layout/jstl.jsp" %>
<%@ include file="/layout/common.jsp" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>projectπ» - ALOHA CLASSπ΄</title>
<jsp:include page="/layout/meta.jsp" />
<jsp:include page="/layout/link.jsp" />
</head>
<body>
<jsp:include page="/layout/header.jsp" />
<%-- [Contents] ######################################################### --%>
<div class="container">
<section>
<h1 class="text-title">λ©μΈ νλ©΄</h1>
<h3>projectπ» - ALOHA CLASSπ΄</h3>
</section>
</div>
<%-- [Contents] ######################################################### --%>
<jsp:include page="/layout/footer.jsp" />
<jsp:include page="/layout/script.jsp" />
</body>
</html>
HTML
볡μ¬