a.jsp
<c:url var="url_comment" value="comment" scope="request">
  <c:param name="id" value="${param.id}" />
</c:url>
<jsp:include page="b.jsp" flush="false"/>

b.jsp
		<html:form action="${url_comment}">
			<html:hidden property="articleId" value="${article.id}"/>
			이름 : <html:text property="name"/>
			비밀번호 : <html:password property="password"/>
			홈페이지 : <html:text property="homepage"/><br>
			<html:textarea property="contents"/>
			<html:submit value="확인"/>
		</html:form>

위의 예제는 a에서 지정한 변수를 b에서 사용하기 위한 것이다. JSTL Core 태그의 기본 변수 범위(Scope)는 Page이기 때문에, 아무런 지정도 하지 않으면 b.jsp의 EL에서는 빈칸만 보게 될 것이다. 범위를 Request로 지정하면 하나의 요청 단위로 변수가 존재하기 때문에 include한 페이지까지 이어지게 된다.
powered by Moniwiki | themed by clockoon
last modified 2008-12-30 10:44:13
Processing time 0.0033 sec