• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using req managed bean in scriplet

 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can any one help me out to use the managed bean of scope request in jsp scriplet.
In my faces-config.xml I have following code.

<managed-bean>
<managed-bean-name>customerBean</managed-bean-name>
<managed-bean-class>com.test.CustomerBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
In my JSP file: I am trying to retrive this bean as bellow

<table>
<%
List<String> addressList= // Need to use my managed bean here//
if(addressList!= null) {

for(int i=0;i<addressList.size(); i++){%>

<TR>

<TD><fieldset style="cursor: hand;"><%addressList.get(i).getAddress()%></fieldset></TD>

</TR>
<%}}%>
</table>
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Disclaimer: I'm not a JSF developer.

I was under the impression that you can reference the beans in the normal J2EE way (with JSTL) e.g. customerBean.getFoobar().

Since I'm definitely not an expert in this area you might want to wait for another answer and/or look here and here

Hope that helps!
 
Everybody! Do the Funky Monkey! Like this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic