How can I include jsp file which contains jsp and jstl tags in the custom tag

620 Views Asked by At

Is it possible to include .jsp file which contains jstl tags in the custom tag class(using tag files isn't an option in my particular case)? For example I need to create custom tag to draw a table with the content of page scope variable. The table.jsp is:

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

I tried to include this jsp using pageContext.include() method but I get all jstl tags on the html page

1

There are 1 best solutions below

1
On

Yes, you can include. pageContext.include() will inturn call RequestDispatcher.include()