///
O trecho de código abaixo está sintaticamente correto.
public void checkSession() {
try {
if (getRequest().getSession() == null
getRequest().getSession().getAttribute
("user") == null){
this.disconnect();
}
} catch (IllegalStateException isex) {
this.disconnect();
}
}