如何在自定义标记中包含包含 jsp 和 jstl 标记的 jsp 文件



是否可以在自定义标签类中包含包含 jstl 标签.jsp文件(在我的特定情况下,使用标签文件不是一种选择)?例如,我需要创建自定义标签来绘制包含页面范围变量内容的表。表.jsp为:

<table>  
  <thead>  
    <tr>  
       <c:if test="${isAdmin }">  
          <th><fmt:message bundle="${prop}" key="orders.table.selected" /></th>  
       </c:if>  
    </tr> 
   more code here  
<table>

我尝试使用pageContext.include()方法包含此 jsp,但我在 html 页面上获得了所有 jstl 标签

是的,你可以包括。 pageContext.include()将反过来呼叫RequestDispatcher.include()

最新更新