Example usage for org.apache.wicket.request.cycle RequestCycle getOriginalResponse

List of usage examples for org.apache.wicket.request.cycle RequestCycle getOriginalResponse

Introduction

In this page you can find the example usage for org.apache.wicket.request.cycle RequestCycle getOriginalResponse.

Prototype

public Response getOriginalResponse() 

Source Link

Document

Get the original response the request was created with.

Usage

From source file:brix.codepress.CodePressEnabler.java

License:Apache License

private String getCodePressPath() {
    RequestCycle requestCycle = RequestCycle.get();
    Url urlFor = requestCycle.mapUrlFor(JS, null);
    List<String> segments = urlFor.getSegments();
    segments.remove(segments.size() - 1);
    return requestCycle.getOriginalResponse().encodeURL(requestCycle.getUrlRenderer().renderUrl(urlFor));
}

From source file:de.alpharogroup.wicket.components.examples.application.ApplicationRequestCycleListener.java

License:Apache License

@Override
public IRequestablePage newExceptionPage(final RequestCycle cycle, final Exception e) {
    e.printStackTrace();/*from w w w .j av a2s.c  o m*/

    final IModel<ReportThrowableModelBean> model = Model
            .of(ReportThrowableModelBean.builder().throwable(e).affectedUsername("test user") // set
                    // the
                    // appropriate
                    // affected
                    // username
                    .description("test description") // set the appropriate description
                    .rootUsername("test rootUsername") // set the appropriate root username
                    .stackTrace(ExceptionExtensions.getStackTrace(e)).responsePage(HomePage.class)
                    .originalResponse(cycle.getOriginalResponse().toString()).build());
    return new ExceptionPage(model);
}

From source file:org.artifactory.common.wicket.util.WicketUtils.java

License:Open Source License

/**
 * Get the absolute bookmarkable path of a page
 *
 * @param pageClass      Page/*from  www.  j  a v a2s. c  o m*/
 * @param pageParameters Optional page parameters
 * @return Bookmarkable path
 */
public static String absoluteMountPathForPage(Class<? extends Page> pageClass, PageParameters pageParameters) {
    HttpServletRequest req = getHttpServletRequest();
    RequestCycle requestCycle = RequestCycle.get();
    Url url = requestCycle.mapUrlFor(pageClass, pageParameters);
    String renderedUrl = url.toString();
    renderedUrl = Strings.isEmpty(renderedUrl) ? "." : renderedUrl;
    return RequestUtils.toAbsolutePath(HttpUtils.getWebappContextUrl(req),
            requestCycle.getOriginalResponse().encodeURL(renderedUrl));
}