Hi,

Thanks for sharing your solution!

If you use Wicket 1.5+ it will be a bit easier - with your own impl of
IRequestMapper you can read the passed request's url. This Url has
#getSegments() method that returns a list of all path parameters. If the
last segment is "productDetails" then you have to use ProductDetails.class
page. All previous segments are the categories.

Martin Grigorov
Wicket Training and Consulting


On Sun, Mar 16, 2014 at 10:13 AM, Arjun Dhar <dhar...@yahoo.com> wrote:

> Ok, for lack of any conclusive existing solution; the following is what I
> developed and works for the use case described:
>
> Step 1: Create a BookmarkablePageRequestTargetUrlCodingStrategy that can
> accept RegularExpressions:
>
>
> Step 2: The default WebRequestCodingStrategy uses a MountMap that
> unfortunately uses path.startsWith(...) . So we have to write a
> WebRequestCodingStrategy that will make use of Regular Expressions.
>
>
> Step 3: The Strategies have to be called via the WebApplication. Hence in
> ones implementation/extension of WebApplication; do:
>
>
> Now run the App. Sample Run/Demo:
>
> If you define RegexQueryStringUrlCodingStrategy("productDetails",
> "^(.)*productDetails", ProductDetails.class);
>
> Then all the following will work:
> <host>/productDetails
> <host>/AnyCat/productDetails
> <host>/AnySubCat/productDetails
> etc.
>
> Q.E.D
> -Arjun
>
> -----
> Software documentation is like sex: when it is good, it is very, very
> good; and when it is bad, it is still better than nothing!
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/WildCard-URL-strategy-for-E-Commerce-Products-tp4664984p4664988.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to