0
매우 간단한 JSP 2.0 태그를 정의하고 싶지만 수행 방법을 모른다.이 간단한 jsp 2.0 태그를 정의하는 방법
태그는 시스템에서 article
개체의 정보를 가져 오는 데 사용됩니다. 그리고 그것은 매우 간단합니다
<sys:article id="123" var="article">
Title: ${aritcle.title}
</sys:article>
그럼 난 WEB-INF/tags/
에서 article.tag
라는 이름의 파일을 생성, 내용은 다음과 같습니다
<% tag import="sys.App, sys.domains.*" %>
<%@ attribute
name="id"
type="java.lang.String"
required="true"
description="the id of an article" %>
<%@ attribute
name="var"
type="java.lang.String"
required="true"
description="let invoker use it to get information" %>
<%
Article article = App.articleDao.get(id);
%>
// how to set article to the body
<jsp:doBody />
나는 몸에 검색된 문서 객체를 설정하는 방법을 알고하지 않으며, 그것의 제목을 보여주십시오.