myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niket Arora" <niket.ar...@induslogic.com>
Subject Mixing JSTL & JSF
Date Tue, 08 Feb 2005 12:54:56 GMT
Hi,

 

I found a problem when I tried to mix JSTL tags with JSF tag. 

 

<c:forEach items="${UserBean.pageExtraPathList}" var="pagePath"
varStatus="currentStatus"  >

      <c:set var="index" value="${currentStatus.index}" scope="request"
></c:set>

      <c:set var="path" value="${pagePath}" scope="request" ></c:set>

      <%System.out.println("index"+request.getAttribute("index")); %>

      <%System.out.println("path"+request.getAttribute("path")); %>

      <h:outputText value="#{index}" />

      <h:outputText value="#{path}" />

</c:forEach>

 

-----------------Console Output----------------------

Index0

Path<<UserBean.pageExtraPathList[0]>>

Index1

Path<<UserBean.pageExtraPathList[1]>>

Index2

Path<<UserBean.pageExtraPathList[2]>>

Index3

Path<<UserBean.pageExtraPathList[3]>>

-----------------------------------------------------



-----------HTML Output on browser--------------------

3<<UserBean.pageExtraPathList[3]>>3<<UserBean.pageExtraPathList[3]>>3<<UserB
ean.pageExtraPathList[3]>>3<<UserBean.pageExtraPathList[3]>>

-----------------------------------------------------

 

My basic need to intermix the two is to include dynamic jsps conditionally.
As there is no <jsp:include/> or <c:import/> like tag in JSF. 

<c:forEach items="${UserBean.pageExtraPathList}" var="pagePath"
varStatus="currentStatus"  >

      <c:set var="index" value="${currentStatus.index}" scope="request"
></c:set>

      <c:set var="path" value="${pagePath}" scope="request" ></c:set>

      <f:subview id="wizardPage#{index}" rendered="#{UserBean.currentPage ==
(index+1)}">

            <c:import url="${pagePath}"></c:import>

      </f:subview>

</c:forEach>

 

Thanks

Niket


Mime
View raw message