동적 내용 (중첩 태그)의 포함 된 사용자 정의 태그가 렌더링되지 않습니다.동적 내용 (중첩 태그)에 포함 된 사용자 정의 태그가 렌더링되지 않음
javabean에서 동적 컨텐트를 가져 와서 html로 처리하기 위해 사용자 목록에 객체 목록을 전달하는 페이지가 있습니다. 각 개체에는 출력 할 html 묶음이 있습니다.이 html에는 렌더링되고 싶은 두 번째 사용자 정의 태그가 있습니다. 문제는 태그 호출이 일반 텍스트로 렌더링된다는 것입니다.
예를 들어 나에게 도움이 될 수 있습니다.
1 데이터베이스에서 정보를 가져 와서 javabean을 통해 페이지로 반환하십시오. 이 정보를 사용자 정의 태그로 보내 출력하십시오.
<jsp:useBean id="ImportantNoticeBean" scope="page" class="com.mysite.beans.ImportantNoticeProcessBean"/> <%-- Declare the bean --%>
<c:forEach var="noticeBean" items="${ImportantNoticeBean.importantNotices}"> <%-- Get the info --%>
<mysite:notice importantNotice="${noticeBean}"/> <%-- give it to the tag for processing --%>
</c:forEach>
이 태그해야 같은 상자 DIV 너무
*SNIP* class for custom tag def and method setup etc
out.println("<div class=\"importantNotice\">");
out.println(" " + importantNotice.getMessage());
out.println(" <div class=\"importantnoticedates\">Posted: " + importantNotice.getDateFrom() + " End: " + importantNotice.getDateTo()</div>");
out.println(" <div class=\"noticeAuthor\">- " + importantNotice.getAuthor() + "</div>");
out.println("</div>");
*SNIP*
이 미세 렌더링하고, 상기 실시 예에서, 예를 들면, I가 있었다 경우
<div class="importantNotice">
<p>This is a very important message. Everyone should pay attenton to it.</p>
<div class="importantnoticedates">Posted: 2008-09-08 End: 2008-09-08</div>
<div class="noticeAuthor">- The author</div>
</div>
2 예상대로 출력 importantNotice.getMessage()에 사용자 정의 태그가 있습니다. 문자열 :
*SNIP* "This is a very important message. Everyone should pay attenton to it. <mysite:quote author="Some Guy">Quote this</mysite:quote>" *SNIP*
중요한주의 사항은 잘 나타내지 만 견적 태그는 처리되지 않고 단순히 문자열에 삽입되어 일반 text/html 태그로 지정됩니다.
<div class="importantNotice">
<p>This is a very important message. Everyone should pay attenton to it. <div class="quote">Quote this <span class="authorofquote">Some Guy</span></div></p> // or wahtever I choose as the output
<div class="importantnoticedates">Posted: 2008-09-08 End: 2008-09-08</div>
<div class="noticeAuthor">- The author</div>
</div>
<div class="importantNotice">
<p>This is a very important message. Everyone should pay attenton to it. <mysite:quote author="Some Guy">Quote this</mysite:quote></p>
<div class="importantnoticedates">Posted: 2008-09-08 End: 2008-09-08</div>
<div class="noticeAuthor">- The author</div>
</div>
보다는
나는이 프로세서 및 사전 프로세서과 관련이있다하지만 난이 일을 만드는 방법에 대해 확실하지 오전 알고있다. 그냥<bodycontent>JSP</bodycontent>
를 사용
는