@@ -0,0 +1,1599 @@
+package com.indoqa.daisy.wicket;%0A%0Aimport java.util.Map;%0A%0Aimport org.apache.cocoon.sitemap.util.WildcardMatcherHelper;%0Aimport org.apache.wicket.RequestCycle;%0Aimport org.apache.wicket.protocol.http.WicketURLDecoder;%0A%0A/**%0A * Use this class to test a wildcard expression whether it matches the current request path provided by Wicket's%0A * RequestCycle request object.%0A * %0A * After the test the %7B@link #get(int)%7D method can be used to retrieve the value for a wildcard.%0A */%0A/*%0A * FIXME To be moved to Indoqa Commons Wicket as soon as the WildcardMatcherHelper is moved to cocoon-utils%0A */%0Apublic class WicketPathMatcher %7B%0A%0A    private String path;%0A    private Map%3CString, String%3E result;%0A    private boolean test;%0A%0A    public WicketPathMatcher() %7B%0A        this.path = WicketURLDecoder.PATH_INSTANCE.decode(RequestCycle.get().getRequest().getPath());%0A%0A        if (this.path.endsWith(%22.html%22)) %7B%0A            this.path = this.path.substring(0, this.path.length() - %22.html%22.length());%0A        %7D%0A    %7D%0A%0A    public String get(int pos) %7B%0A        if (!this.test) %7B%0A            throw new IllegalStateException(%22First test() has to be called.%22);%0A        %7D%0A%0A        if (this.result == null) %7B%0A            return null;%0A        %7D%0A%0A        return this.result.get(Integer.toString(pos));%0A%0A    %7D%0A%0A    public String getPath() %7B%0A        return this.path;%0A    %7D%0A%0A    public boolean test(String expr) %7B%0A        this.test = true;%0A        this.result = WildcardMatcherHelper.match(expr, this.path);%0A%0A        if (this.result == null %7C%7C this.result.isEmpty()) %7B%0A            return false;%0A        %7D%0A%0A        return true;%0A    %7D%0A%7D%0A

add the Wicket path matcher