Session Problems

Hi Guys,

first, sorry for my bad english.

I have a Problem with Session in JSC2. I have a Navigation Fragment, and in that there is a logout button. If i klick that button in the action the following method will be executed:

public String imageHyperlink8_action(){

FacesContext fc = FacesContext.getCurrentInstance();

HttpSession session = (HttpSession)

fc.getExternalContext().getSession(false);

session.invalidate();

returnnull;//"goToCustomer";

}

The problem now is, that we always have to klick twice on the button to logout. And if i wanna login again, it don't works. I have to login twice again, then i come to the start page. After that i wanna go to another page, for which the user is authorized, and i'm forwarded at the login page again.

The security is realized by security realm.

The same problem with the navigation buttons. I save always the actual page into the session, just that the user can see, at which page he is, for which i change the buttons. I always have to klick the button of the page twice, that the button is changed. It doesn't work, even if i redirect to the same page again and reload it.

Does somebody had the same problem or any idea? I would be thankful for every tip.

Thanks a lot.

Cheers Thorsten

[1554 byte] By [stumppthorstena] at [2007-11-27 4:57:27]
# 1
Hi,It looks like something is aborting page navigation. Could you specify what's your security implementation? Is it done by servlet filter or by a phase listener ?regards Grzegorz
Grzegorz.Kluczeka at 2007-7-12 10:12:55 > top of Java-index,Development Tools,Java Tools...
# 2

Thanks for your answer.

It's configured with JBoss Realm. We configuered the files:

-jboss-login.xml(/jbosshome/server/default/conf/)

-web.xml (webapplication)

-jboss-web.xml (in the same directory like the web.xml)

I think the navigation works, but the user shouldn't have access to the page, so he should be forwarded automatically to the login page. And this don't works.

Do you like to see the configuration-file tags?

Cheers Thorsten

stumppthorstena at 2007-7-12 10:12:55 > top of Java-index,Development Tools,Java Tools...
# 3

My guess is that you have implemented security with servlet filter. This works fine when navigation is done by url redirection, however JSF navigation is done by server transfers.

Best solution to secure your application is to use custom PhaseListener. Maybe this will help you:

http://jdj.sys-con.com/read/250254_1.htm

regards

Grzegorz

Grzegorz.Kluczeka at 2007-7-12 10:12:55 > top of Java-index,Development Tools,Java Tools...