Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- maVen
- VirtualBox
- profile
- Quartz
- JavaScript
- plugin
- Windows 10
- vscode
- bash
- port
- ssh
- netsh
- IntelliJ
- import
- 네트워크
- Windows
- resource
- Eclipse
- tomcat
- xargs
- web.xml
- lsof
- grep
- Mac
- GIT
- context
- Source
- find
- 단축키
- 줄바꿈 문자
Archives
- Today
- Total
develog
[java] jsp, include vs jsp:include vs c:import 본문
정적 include : 소스 내용을 포함시킨다
동적 include : 실행 결과를 포함시킨다
section.jsp 를 포함시키는 경우
section.jsp 파일 내용
<% System.out.println("age = " + request.getParameter("age")); %>
header<br>
age: ${param.age}<br>
<br>
Scriptlet Tag
- <%@ include file="" %>
- 정적 include
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
// include
<%@ include file="section.jsp" %>
Action Tag
- <jsp:include page="">
- 동적 include
- param 사용 가능
- 상대, 절대 경로로 접근 ( section.jsp, ../common/section.jsp )
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
// jsp:include
<jsp:include page="section.jsp">
<jsp:param name="age" value="20"/>
</jsp:include>
JSTL
- <c:import url="">
- 동적 include
- param 사용 가능
- url 로 접근
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
// c:import
<c:import url="/test/section.do">
<c:param name="age">30</c:param>
</c:import>
Comments