Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Practice InterviewNew Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

JSF Interview Questions and Answers

Ques. How to terminate the session?
Ans. In order to terminate the session you can use session invalidate method.

This is an example how to terminate the session from the action method of a backing bean:

public String logout() {
FacesContext fc = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession) fc.getExternalContext().getSession(false);
return "login_page";
The following code snippet allows to terminate the session from the jsp page:

<% session.invalidate(); %>
Is it helpful? Yes No

Most helpful rated by users:

©2020 WithoutBook