【问题标题】:How can I include jsp file which contains jsp and jstl tags in the custom tag如何在自定义标签中包含包含 jsp 和 jstl 标签的 jsp 文件
【发布时间】:2012-06-06 19:37:34
【问题描述】:

是否可以在自定义标记类中包含包含 jstl 标记的 .jsp 文件(在我的特定情况下,不能选择使用标记文件)? 例如,我需要创建自定义标签来绘制包含页面范围变量内容的表格。 table.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 标记

【问题讨论】:

    标签: jsp custom-tags


    【解决方案1】:

    是的,您可以加入。 pageContext.include() 将反过来调用RequestDispatcher.include()

    【讨论】:

    • 调用 pageContext.include() 只是将所有 jstl 放入 html 页面而不做任何更改
    猜你喜欢
    • 1970-01-01
    • 2021-06-15
    • 1970-01-01
    • 2012-02-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-22
    • 2012-01-14
    相关资源
    最近更新 更多