Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!