src/java/de/uapcore/lightpit/AbstractLightPITServlet.java

changeset 21
b213fef2539e
parent 20
bd1a76c91d5b
child 22
5a91fb7067af
equal deleted inserted replaced
20:bd1a76c91d5b 21:b213fef2539e
264 Locale sessionLocale = (Locale) session.getAttribute(Constants.SESSION_ATTR_LANGUAGE); 264 Locale sessionLocale = (Locale) session.getAttribute(Constants.SESSION_ATTR_LANGUAGE);
265 resp.setLocale(sessionLocale); 265 resp.setLocale(sessionLocale);
266 LOG.trace("Continuing session {} with language {}", session.getId(), sessionLocale); 266 LOG.trace("Continuing session {} with language {}", session.getId(), sessionLocale);
267 } 267 }
268 268
269 // set some internal request attributes
269 req.setAttribute(Constants.REQ_ATTR_PATH, Functions.fullPath(req)); 270 req.setAttribute(Constants.REQ_ATTR_PATH, Functions.fullPath(req));
270 req.setAttribute(Constants.REQ_ATTR_MODULE_CLASSNAME, this.getClass().getName()); 271 req.setAttribute(Constants.REQ_ATTR_MODULE_CLASSNAME, this.getClass().getName());
271 moduleInfoELProxy.ifPresent((proxy) -> req.setAttribute(Constants.REQ_ATTR_MODULE_INFO, proxy)); 272 moduleInfoELProxy.ifPresent((proxy) -> req.setAttribute(Constants.REQ_ATTR_MODULE_INFO, proxy));
272 273
274
275 // call the handler, if available, or send an HTTP 404 error
273 Optional<HandlerMethod> mapping = findMapping(method, req); 276 Optional<HandlerMethod> mapping = findMapping(method, req);
274 if (mapping.isPresent()) { 277 if (mapping.isPresent()) {
275 forwardAsSepcified(mapping.get().apply(req, resp), req, resp); 278 forwardAsSepcified(mapping.get().apply(req, resp), req, resp);
276 } else { 279 } else {
277 resp.sendError(HttpServletResponse.SC_NOT_FOUND); 280 resp.sendError(HttpServletResponse.SC_NOT_FOUND);

mercurial