Example usage for org.apache.wicket.request IRequestHandler detach

List of usage examples for org.apache.wicket.request IRequestHandler detach

Introduction

In this page you can find the example usage for org.apache.wicket.request IRequestHandler detach.

Prototype

default void detach(IRequestCycle requestCycle) 

Source Link

Document

This method is called at the end of a request cycle to indicate that processing is done and that cleaning up of the subject(s) of this target may be done.

Usage

From source file:org.brixcms.Brix.java

License:Apache License

/**
 * Constructs a URL to the current page. This method can only be called within an active wicket request because it
 * relies on the {@link RequestCycle} threadlocal.
 *
 * @param params parameters to be encoded into the url
 * @return url to the current brix page/*  w w w  .j a v a 2s  .c  o m*/
 * @throws BrixException if the current request was not for a brix page
 */
public static String urlForCurrentPage(BrixPageParameters params) {
    IRequestHandler target = new BrixNodeRequestHandler(getCurrentPage(), params);
    String url = RequestCycle.get().urlFor(target).toString();
    target.detach(RequestCycle.get());
    return url;
}