/** * Sets the page as the render target of this request. * * @param page * The page to render as a response */ public final void setResponsePage(final Page page) { IRequestTarget target = new PageRequestTarget(page); setRequestTarget(target); }
/** * Sets the page as the render target of this request. * * @param page * The page to render as a response */ public final void setResponsePage(final Page page) { IRequestTarget target = new PageRequestTarget(page); setRequestTarget(target); }
/** * Sets the page class with optionally the page parameters and page map name as the render * target of this request. * * @param pageClass * The page class to render as a response * @param pageParameters * The page parameters that gets appended to the bookmarkable url, * @param pageMapName * The pagemap in which the response page should be created */ public final void setResponsePage(final Class pageClass, final PageParameters pageParameters, final String pageMapName) { IRequestTarget target = new BookmarkablePageRequestTarget(pageMapName, pageClass, pageParameters); setRequestTarget(target); }
/** * Sets the page class with optionally the page parameters and page map name as the render * target of this request. * * @param <C> * * @param pageClass * The page class to render as a response * @param pageParameters * The page parameters that gets appended to the bookmarkable url, * @param pageMapName * The Pagemap in which the response page should be created */ public final <C extends Page> void setResponsePage(final Class<C> pageClass, final PageParameters pageParameters, final String pageMapName) { IRequestTarget target = new BookmarkablePageRequestTarget(pageMapName, pageClass, pageParameters); setRequestTarget(target); }
private void setResponse(final String responseText) { RequestCycle.get().setRequestTarget(new IRequestTarget() { public void respond(RequestCycle requestCycle) { final WebResponse response = (WebResponse) requestCycle.getResponse(); final Application app = Application.get(); final String encoding = app.getRequestCycleSettings().getResponseRequestEncoding(); response.setCharacterEncoding(encoding); response.setContentType("text/xml; charset=" + encoding); // Make sure it is not cached by a client response.setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); response.setHeader("Cache-Control", "no-cache, must-revalidate"); response.setHeader("Pragma", "no-cache"); response.write("<?xml version=\"1.0\" encoding=\""); response.write(encoding); response.write("\"?>"); response.write("<ajax-response>"); response.write(responseText); response.write("</ajax-response>"); } public void detach(RequestCycle requestCycle) { } }); } }
@Override public void onClick() { DownloadRequestTarget requestTarget = createDownloadRequestTarget(); RequestCycle.get().setRequestTarget(requestTarget); }
/** * Continue to the location previous to this interception. */ protected final void continueToPrevious() { // continue to original destination RequestCycle.get().setRequestTarget(new RedirectRequestTarget(continueTo)); }
@Override public void onClick() { DownloadRequestTarget requestTarget = createDownloadRequestTarget(); RequestCycle.get().setRequestTarget(requestTarget); }
/** * Continue to the location previous to this interception. */ protected final void continueToPrevious() { // continue to original destination RequestCycle.get().setRequestTarget(new RedirectRequestTarget(continueTo)); }
/** * Construct. * * @param errorCode * the servlet error code; use one of the * {@link javax.servlet.http.HttpServletResponse} constants * @param message * the optional message to send to the client * @see javax.servlet.http.HttpServletResponse */ public AbortWithWebErrorCodeException(int errorCode, String message) { this.errorCode = errorCode; RequestCycle.get().setRequestTarget(new WebErrorCodeResponseTarget(errorCode, message)); }
/** * Construct. * * @param errorCode * the servlet error code; use one of the * {@link javax.servlet.http.HttpServletResponse} constants * @param message * the optional message to send to the client * @see javax.servlet.http.HttpServletResponse */ public AbortWithWebErrorCodeException(int errorCode, String message) { this.errorCode = errorCode; RequestCycle.get().setRequestTarget(new WebErrorCodeResponseTarget(errorCode, message)); }
/** * <p>onSubmit.</p> */ public void onSubmit() { super.onSubmit(); RequestCycle requestCycle = RequestCycle.get(); requestCycle.setRequestTarget( RequestTargetFactory.buildFromTransition(eventId, requestCycle)); // FlowUtils.setResponsePageForEventId(this.getEventId()); }
/** {@inheritDoc} */ @Override public void respond(RequestCycle requestCycle) { IRequestTarget requestTarget = requestCycle.getRequestTarget(); if (requestTarget != null) { IRequestTarget secured = checkSecureOutgoing(requestTarget); if (secured != requestTarget) { requestCycle.setRequestTarget(secured); // respond will be called again because we called setrequesttarget(), so we do not // process it this time return; } } super.respond(requestCycle); } }
/** * Redirects to any intercept page previously specified by a call to redirectToInterceptPage. * * @return True if an original destination was redirected to * @see PageMap#redirectToInterceptPage(Page) */ public final boolean continueToOriginalDestination() { // Get request cycle final RequestCycle cycle = RequestCycle.get(); // If there's a place to go to if (interceptContinuationURL != null) { cycle.setRequestTarget(new RedirectRequestTarget(interceptContinuationURL)); // Reset interception URL interceptContinuationURL = null; // Force session to replicate page maps dirty(); return true; } return false; }
/** * Redirects to any intercept page previously specified by a call to redirectToInterceptPage. * * @return True if an original destination was redirected to * @see PageMap#redirectToInterceptPage(Page) */ public final boolean continueToOriginalDestination() { // Get request cycle final RequestCycle cycle = RequestCycle.get(); // If there's a place to go to if (interceptContinuationURL != null) { cycle.setRequestTarget(new RedirectRequestTarget(interceptContinuationURL)); // Reset interception URL interceptContinuationURL = null; // Force session to replicate page maps dirty(); return true; } return false; }
@Override public void onClick() { JcrNodeModel model = (JcrNodeModel) getModel(); modelReference.setModel(model); JcrExportRequestTarget rsrt = new JcrExportRequestTarget(model.getNode()); RequestCycle.get().setRequestTarget(rsrt); }
/** * @see org.apache.wicket.behavior.IBehaviorListener#onRequest() */ public final void onRequest() { WebApplication app = (WebApplication)getComponent().getApplication(); AjaxRequestTarget target = app.newAjaxRequestTarget(getComponent().getPage()); RequestCycle.get().setRequestTarget(target); respond(target); }
/** * @see org.apache.wicket.behavior.IBehaviorListener#onRequest() */ public final void onRequest() { WebApplication app = (WebApplication)getComponent().getApplication(); AjaxRequestTarget target = app.newAjaxRequestTarget(getComponent().getPage()); RequestCycle.get().setRequestTarget(target); respond(target); }
@Override public void onClick() { OAuthData oauth = getModelObject(); String redirectURL = buildRedirectURL(getRequest()); oauth.setRedirectURL(redirectURL); String link = oauth.generateFirstCallLink(); OAuthPageFactory.putOAuthObject(getSession().getId(), oauth); getRequestCycle().setRequestTarget(new RedirectRequestTarget(link)); } };
public void respond(RequestCycle requestCycle) { try { HttpServletRequest request = new CocoonWicketRequestWrapper(((WebRequest) requestCycle.getRequest()) .getHttpServletRequest()); this.requestProcessor.service(request, ((WebResponse) requestCycle.getResponse()).getHttpServletResponse()); } catch (NoMatchingPipelineException e) { WebApplication.get().getExceptionSettings().setUnexpectedExceptionDisplay( IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE); RequestCycle.get().setRequestTarget(new WebErrorCodeResponseTarget(404)); } catch (Exception e) { throw new CocoonRuntimeException("Error occurred while executing a Cocoon sitemap.", e); } }