This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Milan Mendpara
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 ..
 
Juan Manuel Diaz
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!