myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Wessendorf <maili...@matthias-wessendorf.de>
Subject Re: Mixing JSTL & JSF
Date Tue, 08 Feb 2005 13:02:52 GMT
Hi,

<c:forEach/> does not work with JSF
but some other JSTL tags may work
(eg <jsp:include/> or <c:import/>)

See spec of JSF and/or this article:
http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html

BTW. Oracle's ADF Faces (a set of JSF components)
ship such a "forEach" component.

HTH,
Matthias


Niket Arora wrote:
> 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
> 
> 

-- 
Matthias We├čendorf
Aechterhoek 18
DE-48282 Emsdetten
Germany
phone: +49-2572-9170275
cell phone: +49-179-1118979
email: matzew AT apache DOT org
url: http://www.wessendorf.net
callto://mwessendorf (Skype)
icq: 47016183

Mime
View raw message