Example usage for org.apache.wicket.request.mapper.info PageComponentInfo parse

List of usage examples for org.apache.wicket.request.mapper.info PageComponentInfo parse

Introduction

In this page you can find the example usage for org.apache.wicket.request.mapper.info PageComponentInfo parse.

Prototype

public static PageComponentInfo parse(final String s) 

Source Link

Document

Parses the given string

Usage

From source file:org.hippoecm.frontend.plugins.login.LoginPlugin.java

License:Apache License

@Override
protected void onBeforeRender() {
    super.onBeforeRender();

    Request request = RequestCycle.get().getRequest();

    /**//from w w w.  j a v  a2  s  .  c  om
     * Strip the first query parameter from URL if it is empty
     * Copied from {@link AbstractComponentMapper#removeMetaParameter}
     */
    Url urlCopy = new Url(request.getUrl());
    if (!urlCopy.getQueryParameters().isEmpty()
            && Strings.isEmpty(urlCopy.getQueryParameters().get(0).getValue())) {
        String pageComponentInfoCandidate = urlCopy.getQueryParameters().get(0).getName();
        if (PageComponentInfo.parse(pageComponentInfoCandidate) != null) {
            urlCopy.getQueryParameters().remove(0);
        }
    }

    parameters = new PageParametersEncoder().decodePageParameters(urlCopy);
}