public String toCallbackURL() { return urlFor(Brix.getCurrentPage()); }
/** * 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 * @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; }
public static BrixPageParameters getCurrent() { IRequestHandler target = RequestCycle.get().getActiveRequestHandler(); // this is required for getting current page parameters from page // constructor // (the actual page instance is not constructed yet. if (target instanceof PageParametersRequestHandler) { return ((PageParametersRequestHandler) target).getPageParameters(); } else { return new BrixPageParameters(Brix.getCurrentPage().getPageParameters()); } }