This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Problem of maintaining reference of an object by the request of same jsf page  RSS feed

 
Greenhorn
Posts: 7
Java Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a page(say A.jsf) from which a managed bean action method is called then it navigate to another jsf page(lsay B.jsf) along with one object.now again when i do some action on that page(B.jsf) the object got null reference. my bean scope is ReuestScoped........
<f:setPropertyActionListener target="#{zoneBean.zoneID}" value="#{row.zoneId}" />

so how can maintain the reference of that object ???

in A.jsf i'm doing something like this ..

<h:commandLink value="Edit" action="#{zoneBean.edit}" >
<f:setPropertyActionListener target="#{zoneBean.zoneObj}" value="#{row}" />
</h:commandLink>

thanks in advance ..
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!,

You can change the scope of your bean to session (@SessionScoped) and the reference to the zoneBean object will stay there! If you use request session, the bean will be created and destroy every time it is called.

Regards,
JM
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!