It's not a secret anymore!*
The moose likes JSF and the fly likes destroy/reset a session scope bean when a blah.faces is called Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "destroy/reset a session scope bean when a blah.faces is called" Watch "destroy/reset a session scope bean when a blah.faces is called" New topic
Author

destroy/reset a session scope bean when a blah.faces is called

Pachan
Greenhorn

Joined: Sep 05, 2008
Posts: 2
Hi, I'm having a lot of problems with this situation:

Every time a blah.faces page is called I need to destroy/reset the session-scope back bean associated in order to get a clean bean (without garbage data from old requests) . The page can be accessed:
- from other page
- writing the url
- from the "back" button

I read a lot of post about similar situations but I haven't found the correct answer yet. I've found things like:

- using a kind of hack to write the destroy/reset() logic into the get method of a hidden component. (the problem is that the get method is called several times)
- phaseListeners
- PostConstruct annotations
...

I don't know if there is another way to solve this problem so if somebody can help me I'll be so thankful.

P.S:Using myfaces 1.1.5 implementation
__
This is my firs message here, hi everybody.
Sorry about any writing mistakes.

[ September 05, 2008: Message edited by: Octavio Martinez ]

[ September 05, 2008: Message edited by: Pachan ]
[ September 05, 2008: Message edited by: Pachan ]
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Crossposted: http://forums.sun.com/thread.jspa?threadID=5329248

Don't do that without being forthright: http://faq.javaranch.com/java/BeForthrightWhenCrossPostingToOtherSites
Pachan
Greenhorn

Joined: Sep 05, 2008
Posts: 2
ok, I hadn't read it. My fault.

Sorry about it.
[ September 06, 2008: Message edited by: Pachan ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: destroy/reset a session scope bean when a blah.faces is called