본문 바로가기
2222
etc/JSP

액션 태그에서 param 이용방법

by PARK TAE JOON 2020. 11. 9.

# first.jsp

<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	second.jsp입니다.
	<jsp:include page="second.jsp" >
		<jsp:param name="date" value="${Date()}" />
	</jsp:include>
</body>
</html>

 

# second.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	today is : <%=request.getParameter("date")%>
</body>
</html>

 

'etc > JSP' 카테고리의 다른 글

WELCOME 페이지 제작  (0) 2021.01.15
include를 사용해서 배분하기  (0) 2020.11.09
HTML로 만들어진 페이지 JSP이용해서 자바 웹 프로그래밍  (0) 2020.11.09
MVC 방식으로 나누기  (0) 2020.11.05

댓글