use of org.mycore.frontend.servlets.MCRServletJob in project mycore by MyCoRe-Org.
the class MCRParameterCollector method getInstanceFromUserSession.
public static MCRParameterCollector getInstanceFromUserSession() {
MCRSession mcrSession = MCRSessionMgr.getCurrentSession();
MCRServletJob job = (MCRServletJob) mcrSession.get("MCRServletJob");
return job == null ? new MCRParameterCollector() : new MCRParameterCollector(job.getRequest());
}
use of org.mycore.frontend.servlets.MCRServletJob in project mycore by MyCoRe-Org.
the class MCRFrontendUtil method configureSession.
public static void configureSession(MCRSession session, HttpServletRequest request, HttpServletResponse response) {
session.setServletJob(new MCRServletJob(request, response));
// language
getProperty(request, "lang").ifPresent(session::setCurrentLanguage);
// Set the IP of the current session
if (session.getCurrentIP().length() == 0) {
session.setCurrentIP(getRemoteAddr(request));
}
// set BASE_URL_ATTRIBUTE to MCRSession
if (request.getAttribute(BASE_URL_ATTRIBUTE) != null) {
session.put(BASE_URL_ATTRIBUTE, request.getAttribute(BASE_URL_ATTRIBUTE));
}
// Store XSL.*.SESSION parameters to MCRSession
putParamsToSession(request);
}
Aggregations