File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Problem in session scope. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Problem in session scope." Watch "Problem in session scope." New topic

Problem in session scope.

prasad kakani
Ranch Hand

Joined: Jul 15, 2008
Posts: 59
Hi All,

I am quite confused working with bean scopes. All beans are maintained in session scopes in my application. The home screen,the header part contains some buttons, home , goto app1, goto app2. This screen comes after login the login screen.

My problem is , After entering the login screen, we are brought to home screen, from that if we click goto app2 button, then redirected to app2 screen. In app2 there is a search criteria,and entering all the required details, and click on the fetch button,data is coming in the grid.This is all fine. From here , if i go home screen , and again , if i click the 'goto app2' link, the same data , whatever i have performed previously, is coming.

Do not know what is the reason. Can any one please clarifies this?

Brajendra Mathema
Ranch Hand

Joined: Jun 02, 2009
Posts: 39
Since your bean is in session scope, the data you have fetched would be there till the current session is active.

You can use request scope or you have to remove the fetched contents from you session while you are redirecting to your home page.

Please go through the request/session scope.

subject: Problem in session scope.
It's not a secret anymore!