• 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

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

 
Greenhorn
Posts: 7
Netbeans IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Fire me boy! Cool, soothing, shameless self promotion:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic