简体   繁体   中英

How to let JSF skip getter method call after clicking of button on that page?

Actualy I want after clicking logout session get invalidate. But it is going firstly on getter setter and there I created a session. After that is goes to session invalidate method. And it will throw exception.

How would I skip getter setter on click of button and directly call the action method?

Just don't do business job in getters/setters. The getters/setters should solely do the things as their name suggests: returning a property or setting a property. Nothing more. It should not load/preinitialize properties. The loading/preinitializing should be done by a (post)constructor or action(listener) method.

See also:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM