wood burning stoves 2.0*
The moose likes JSF and the fly likes Show HashMap forEach Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Show HashMap forEach" Watch "Show HashMap forEach" New topic
Author

Show HashMap forEach

Mario Fatone
Greenhorn

Joined: Apr 07, 2008
Posts: 4
Hey,

My problem is that i can't resolve an issue with forEach.
I have hashmap declared in faces-config.xml
<managed-bean>
<managed-bean-name>brg_mapExistings</managed-bean-name>
<managed-bean-class>java.util.HashMap</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>

This hashMap is filled in my ProcessAction function, ( i do also syste.out.println to check if the hashMap is not empty)

in my jsp, however in my forEach, it will only loop once

<c:set value="#{brg_mapExistings}" var="MapEntries" scope="session" />
<c:forEach var="serv" items="MapEntries">
test some text
</c:forEach>

What am i doing wrong?
[ April 29, 2008: Message edited by: Mario Fatone ]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15962
    
  19

This is a question you really should have asked in the JSP forum. JSTL isn't JSF, and in many cases it's not safe to use both on the same page.


Customer surveys are for companies who didn't pay proper attention to begin with.
Paul Michael
Ranch Hand

Joined: Jul 02, 2001
Posts: 697
I agree with Tim, that was the case until JSP 2.1/JSF 1.2 which now defines the Unified EL.

Thanks to the Unified EL, JSTL tags, such as the JSTL iteration tags, can now be used with JSF components in an intuitive way.


Checkout http://java.sun.com/products/jsp/ for more details.


SCJP 1.2 (89%), SCWCD 1.3 (94%), IBM 486 (90%), SCJA Beta (96%), SCEA (91% / 77%), SCEA 5 P1 (77%), SCBCD 5 (85%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Show HashMap forEach
 
Similar Threads
is there a mayor change on how to use faces-config.xml on JSF 2.0
Not creating managed bean
HashMap forEach
Displaying simple read-only tabular data
Display using DataTable