• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using req managed bean in scriplet

 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • 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>
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • 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!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!