parameters.put(Environment.TARGET_ID, getTargetId());
/** * <p> * Override handleRequest in order to perform processing specific to this component.</p> * * <p> * When the new browser window for the document content is opened, it will make another request to fetch the * content. It is that situation we are trying to detect and handle here.</p> * * @param request the request being responded to. */ @Override public void handleRequest(final Request request) { resetDisplayRequested(); // Has this component been targeted to return the document content? // Look in the request for the target parameter and see if it's for us. // The target parameter is encoded into the url in the javascript that // was rendered by this component to open the new browser window. String targ = request.getParameter(Environment.TARGET_ID); boolean contentReqested = targ != null && targ.equals(getTargetId()); if (contentReqested) { ContentEscape escape = new ContentEscape(getContentAccess()); escape.setCacheable(!Util.empty(getCacheKey())); escape.setDisplayInline(getDisplayMode() != DisplayMode.PROMPT_TO_SAVE); throw escape; } }
request.setParameter(Environment.TARGET_ID, wContent.getTargetId());