Map<String, String[]> oldParamMap = null; if (paramMap.size() > 0) { oldParamMap = req.getParameterMap(); req.addParameterMap(paramMap); Map<String, Object> oldAttrMap = null; if (attrMap.size() > 0) { oldAttrMap = req.getAttributeMap(); req.addAttributeMap(cloneAttributes(attrMap)); req.getRequestDispatcher((String)o).include(req, res); req.setParameterMap(oldParamMap); req.setAttributeMap(oldAttrMap);
/** * Constructs a new wrapper layer around an (already wrapped) CmsFlexRequest.<p> * * @param req the request to be wrapped * @param controller the controller to use * @param resource the target resource that has been requested */ CmsFlexRequest(HttpServletRequest req, CmsFlexController controller, String resource) { super(req); m_controller = controller; m_elementUri = CmsLinkManager.getAbsoluteUri(resource, m_controller.getCurrentRequest().getElementUri()); m_elementUriSiteRoot = m_controller.getCurrentRequest().m_elementUriSiteRoot; m_isOnline = m_controller.getCurrentRequest().isOnline(); m_canCache = m_controller.getCurrentRequest().isCacheable(); m_doRecompile = m_controller.getCurrentRequest().isDoRecompile(); m_includeCalls = m_controller.getCurrentRequest().getCmsIncludeCalls(); m_parameters = req.getParameterMap(); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_FLEXREQUEST_REUSING_FLEX_REQUEST_1, m_elementUri)); } }
/** * This is a work around for servlet containers creating a new application dispatcher * instead of using our request dispatcher, so missing RFS JSP pages are not requested to * OpenCms and the dispatcher is unable to load the included/forwarded JSP file.<p> * * @see javax.servlet.http.HttpServletRequestWrapper#getServletPath() */ @Override public String getServletPath() { // unwrap the request to prevent multiple unneeded attempts to generate missing JSP files // m_controller.getTopRequest() does not return the right request here when forwarding // this method is generally called exactly once per request on different servlet containers // only resin calls it twice ServletRequest req = getRequest(); while (req instanceof CmsFlexRequest) { req = ((CmsFlexRequest)req).getRequest(); } String servletPath = null; if (req instanceof HttpServletRequest) { servletPath = ((HttpServletRequest)req).getServletPath(); } else { servletPath = super.getServletPath(); } // generate missing JSP file CmsJspLoader jspLoader = getJspLoader(); if (jspLoader != null) { jspLoader.updateJspFromRequest(servletPath, this); } return servletPath; }
if (f_req.exceedsCallLimit(m_vfsTarget)) { f_req.addInlucdeCall(m_vfsTarget); f_req.removeIncludeCall(m_vfsTarget); return; CmsFlexRequest w_req = new CmsFlexRequest((HttpServletRequest)req, controller, m_vfsTarget); CmsFlexResponse w_res = new CmsFlexResponse((HttpServletResponse)res, controller); if (f_req.isCacheable()) { entry = cache.get(w_req.getCmsCacheKey()); if (entry != null) { CmsFlexCacheKey res_key = cache.getKey(CmsFlexCacheKey.getKeyName(m_vfsTarget, w_req.isOnline())); if (res_key != null) { cms.getRequestContext().addSiteRoot(m_vfsTarget), cacheProperty, f_req.isOnline())); } catch (CmsFlexCacheException e) { if (w_req.isCacheable()) { variation = w_res.getCmsCacheKey().matchRequestKey(w_req.getCmsCacheKey()); if ((entry != null) && (variation != null) && w_req.isCacheable()) { f_req.removeIncludeCall(m_vfsTarget);
if (f_req.containsIncludeCall(m_vfsTarget)) { m_vfsTarget)); } else { f_req.addInlucdeCall(m_vfsTarget); f_req.removeIncludeCall(m_vfsTarget); return; CmsFlexRequest w_req = new CmsFlexRequest((HttpServletRequest)req, controller, m_vfsTarget); CmsFlexResponse w_res = new CmsFlexResponse((HttpServletResponse)res, controller); if (f_req.isCacheable()) { entry = cache.get(w_req.getCmsCacheKey()); if (entry != null) { CmsFlexCacheKey res_key = cache.getKey(CmsFlexCacheKey.getKeyName(m_vfsTarget, w_req.isOnline())); if (res_key != null) { cms.getRequestContext().addSiteRoot(m_vfsTarget), cacheProperty, f_req.isOnline())); } catch (CmsFlexCacheException e) { if (w_req.isCacheable()) { variation = w_res.getCmsCacheKey().matchRequestKey(w_req.getCmsCacheKey()); if ((entry != null) && (variation != null) && w_req.isCacheable()) {
Map oldMap = null; if (map.size() > 0) { oldMap = req.getParameterMap(); req.addParameterMap(map); req.getRequestDispatcher((String)o).include(req, res); req.setParameterMap(oldMap);
/** * Wraps the request URI, overloading the standard API.<p> * * This ensures that any wrapped request will use the "faked" * target parameters. Remember that for the real request, * a mixture of PathInfo and other request information is used to * identify the target.<p> * * @return a faked URI that will point to the wrapped target in the VFS * * @see javax.servlet.http.HttpServletRequest#getRequestURI() */ @Override public String getRequestURI() { if (m_requestUri != null) { return m_requestUri; } StringBuffer buf = new StringBuffer(128); buf.append(OpenCms.getSystemInfo().getOpenCmsContext()); buf.append(getElementUri()); m_requestUri = buf.toString(); return m_requestUri; }
target = CmsLinkManager.getAbsoluteUri(target, controller.getCurrentRequest().getElementUri()); controller.getCurrentRequest().addParameterMap(parameterMap); : new HashMap<String, Object>(attrMap); controller.getCurrentRequest().addAttributeMap(attributeMap); if (cacheable) { controller.getCurrentRequest().setParameterMap(oldParameterMap);
target = CmsLinkManager.getAbsoluteUri(target, controller.getCurrentRequest().getElementUri()); controller.getCurrentRequest().addParameterMap(parameterMap); if (cacheable) { controller.getCurrentRequest().setParameterMap(oldParameterMap);
CmsFlexResponse f_res = controller.getCurrentResponse(); try { f_req.getRequestDispatcher(controller.getCmsObject().getSitePath(controller.getCmsResource())).include( f_req, f_res); && !isWorkplaceUser && CmsFlexController.isNotModifiedSince(f_req, controller.getDateLastModified())) { if (f_req.getParameterMap().size() == 0) { if ((f_req.getParameterMap().size() == 0) && (controller.getDateLastModified() > -1)) {
CmsFlexRequest f_req = new CmsFlexRequest(req, controller); CmsFlexResponse f_res = new CmsFlexResponse(res, controller, streaming, true); controller.push(f_req, f_res);
I_CmsResourceLoader.PARAMETER_ELEMENT, value); controller.getCurrentRequest().addParameterMap(parameters); controller.getCurrentRequest().addAttributeMap(CmsRequestUtil.getAtrributeMap(req));
String jspVfsName = CmsLinkManager.getAbsoluteUri(vfsName, controller.getCurrentRequest().getElementRootPath()); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_UPDATE_JSP_1, jspVfsName));
String pathInfo = request.getPathInfo(); if (pathInfo != null) { jspUri += pathInfo;
controller.getCurrentRequest().addParameterMap(parameters);
Map oldParameterMap = controller.getCurrentRequest().getParameterMap(); controller.getCurrentRequest().addParameterMap(parameterMap); context.getOut().print(CmsFlexResponse.FLEX_CACHE_DELIMITER); controller.getCurrentResponse().addToIncludeList(jspIncludeFile, parameterMap); controller.getCurrentRequest().getRequestDispatcher(jspIncludeFile).include(req, res); controller.getCurrentRequest().setParameterMap(oldParameterMap);
/** * Wraps the request URI, overloading the standard API.<p> * * This ensures that any wrapped request will use the "faked" * target parameters. Remember that for the real request, * a mixture of PathInfo and other request information is used to * identify the target.<p> * * @return a faked URI that will point to the wrapped target in the VFS * * @see javax.servlet.http.HttpServletRequest#getRequestURI() */ @Override public String getRequestURI() { if (m_requestUri != null) { return m_requestUri; } StringBuffer buf = new StringBuffer(128); buf.append(OpenCms.getSystemInfo().getOpenCmsContext()); buf.append(getElementUri()); m_requestUri = buf.toString(); return m_requestUri; }
f_req.getRequestDispatcher(controller.getCmsObject().getSitePath(controller.getCmsResource())).include( f_req, f_res); && !isWorkplaceUser && CmsFlexController.isNotModifiedSince(f_req, controller.getDateLastModified())) { if (f_req.getParameterMap().size() == 0) { if ((f_req.getParameterMap().size() == 0) && (controller.getDateLastModified() > -1)) {
CmsFlexRequest f_req = new CmsFlexRequest(req, controller); CmsFlexResponse f_res = new CmsFlexResponse(res, controller, streaming, true); controller.push(f_req, f_res);
String jspVfsName = CmsLinkManager.getAbsoluteUri(vfsName, controller.getCurrentRequest().getElementRootPath()); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_UPDATE_JSP_1, jspVfsName));