• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Show HashMap forEach

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Saloon Keeper
Posts: 28410
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic