oldsess = SessionsCtrl.getRawCurrent();
SessionsCtrl.setCurrent(new SessionResolverImpl(_ctx, request));
//it might be created later
}
WebApp wapp;
Session sess;
final Object old = hsess != null?
(wapp = WebManager.getWebAppIfAny(_ctx)) != null &&
(sess = SessionsCtrl.getSession(wapp, hsess)) != null ?
I18Ns.setup(sess, request, response, "UTF-8"):
I18Ns.setup(hsess, request, response, "UTF-8"):
Charsets.setup(null, request, response, "UTF-8");
try {
cwr.service(request, response,
pi.substring(ClassWebResource.PATH_PREFIX.length()));
} finally {
if (hsess != null) I18Ns.cleanup(request, old);
else {
Charsets.cleanup(request, old);
SessionsCtrl.setRawCurrent(oldsess);
}
}
return; //done
}
final Session sess = WebManager.getSession(_ctx, request, false);
if (withpi) {
final AuExtension aue = getAuExtensionByPath(pi);
if (aue == null) {
response.sendError(response.SC_NOT_FOUND);
log.debug("Unknown path info: "+pi);
return;
}
Object oldsess = null;
if (sess == null) {
oldsess = SessionsCtrl.getRawCurrent();
SessionsCtrl.setCurrent(new SessionResolverImpl(_ctx, request));
//it might be created later
}
final Object old = sess != null?
I18Ns.setup(sess, request, response, "UTF-8"):
Charsets.setup(null, request, response, "UTF-8");
try {
aue.service(request, response, pi);
} finally {
if (sess != null) I18Ns.cleanup(request, old);
else {
Charsets.cleanup(request, old);
SessionsCtrl.setRawCurrent(oldsess);
}
}
return; //done
}
//AU
if (sess == null) {
response.setIntHeader("ZK-Error", response.SC_GONE); //denote timeout
//Bug 1849088: rmDesktop might be sent after invalidate
//Bug 1859776: need send response to client for redirect or others
final WebApp wapp = WebManager.getWebAppIfAny(_ctx);
final String dtid = getAuDecoder(wapp).getDesktopId(request);
if (dtid != null)
sessionTimeout(request, response, wapp, dtid);
return;
}