0

Hi!

i'm a new user of jsf.
I'm developing a web application in jsf 2.0 . There is a page in my application for which i have given session scope.
In this page i retrieve values in a datatable from mysql database according to the chosen combo box values.
I navigate from this page to some other pages in my application and when i come back to this same page again the previous values displayed already from the database remains as such since the bean scope is session.
I have to reset the values of datatable and combobox.
Any help appreciated.
Thanks in advance.

Regards,
Indu

2
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by indu_ss4
0

I don't know anything about jsf, but can you make it so it won't be session scope?
If you had already thought of that, then sorry, but that's all I can think of.

0

Thanks for your response..
I used only request bean in the beginning but later there is a need for me to make it as a session bean.
can you suggest any solution to reset the session when i re-enter the page?

Regards,
Indu

0

I think that when the page loads, you can remove the object from the session, or take the object and create a new instance.

0

Thanks for your idea..
Can you give me any sample code for that?
I tried with

FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove("MyBean");

but it didnt work...

Regards,
Indu

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

0

Look at the API of the methods you are using. If getSessionMap returns a Map object, then try to print the keys that it has.

Also when you call that code. You need to post your code, so we can see what exactly are doing.

0

Hi!

Thanks a lot for your help.I have solved this issue by getting those session variables and clearing it.

Regards,
Indu

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.