final HttpSession hsess =
shallSession(cwr, pi) ? request.getSession(false): null;
Object oldsess = null;
if (hsess == null) {
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"):