처음해보는 include 액션 태그라 접근이 어려웠다.. 결국 하긴했지만 아직 까지 이해가 잘안된다.. 이번 주말동안 include 액션태그에 대해서 공부를 해야겠다..



<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<title>JSP - Hello World</title>
</head>
<body>
<%
String pro=request.getParameter("pro");
if(pro==null){
pro="Product"+".jsp";
}else{
pro+=".jsp";
}
%>
<table border="1" align="center">
<tr>
<td COLSPAN="2">
<%@include file="Header.jsp"%>
</td>
</tr>
<tr>
<td>
<jsp:include page="0916Ex.jsp"/>
</td>
<td>
<jsp:include page="<%=pro%>"/>
</td>
</tr>
<tr>
<td COLSPAN="2">
<%@include file="footer.jsp"%>
</td>
</tr>
</table>
</body>
</html>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
String pro=request.getParameter("pro");
%>
<html>
<head>
<title>Title</title>
</head>
<body>
<!-- hihi 이주석은 개발자도구에서 보임-->
<a href="?pro=Product">신상품</a>
<br>
<br>
<a href="?pro=popProduct">인기상품</a>
<%-- jsp...--%>
</body>
</html>'JSP' 카테고리의 다른 글
| [JSP]Forward와 sendRedirect 사용해보기 (0) | 2022.09.19 |
|---|---|
| [jsp] scope활용해서 값넘겨보기 (0) | 2022.09.19 |
| 구구단 만들기 (0) | 2022.09.19 |
| What is Scope? (1) | 2022.09.16 |
| 나만의 에러페이지 만들기 (0) | 2022.09.16 |
댓글