Last change
on this file since 68 was
68,
checked in by cbipsl, 14 years ago
|
commit v1 eccad
|
-
Property svn:executable set to
*
|
File size:
957 bytes
|
Line | |
---|
1 | package org.medias.eccad.presentation.bean; |
---|
2 | |
---|
3 | import javax.faces.context.FacesContext; |
---|
4 | import javax.servlet.http.HttpSession; |
---|
5 | |
---|
6 | public class AbstractVueBean { |
---|
7 | /** |
---|
8 | * Permet de détecter si une session s'est terminée ou non |
---|
9 | * |
---|
10 | */ |
---|
11 | protected void controleSession() { |
---|
12 | if (FacesContext.getCurrentInstance() == null) |
---|
13 | throw new DeconnectionException(); |
---|
14 | |
---|
15 | if (FacesContext.getCurrentInstance().getExternalContext() == null) |
---|
16 | throw new DeconnectionException(); |
---|
17 | |
---|
18 | if ((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false) == null) |
---|
19 | throw new DeconnectionException(); |
---|
20 | |
---|
21 | |
---|
22 | SessionBean sessionbean = (SessionBean)((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getAttribute("sessionBean"); |
---|
23 | |
---|
24 | if (sessionbean == null) |
---|
25 | throw new DeconnectionException(); |
---|
26 | |
---|
27 | if (sessionbean.getEmail() == null || sessionbean.getEmail() == "") |
---|
28 | throw new DeconnectionException(); |
---|
29 | } |
---|
30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.