Re: WildCard URL strategy for E-Commerce Products
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 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: > /productDetails > /AnyCat/productDetails > /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 > >
Re: WildCard URL strategy for E-Commerce Products
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: /productDetails /AnyCat/productDetails /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
Re: WildCard URL strategy for E-Commerce Products
:) The question isn't about "Page Params" A mount needs a Mouth path thats what the question is... How do you mount a path where a certain part of it can be anything (not significant) ? Explicitly loading mouth paths for "EACH" product (as a separate product page) would not be wise in my opinion. - 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-tp4664984p4664987.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
Re: WildCard URL strategy for E-Commerce Products
Mount your product details page and then use PagePatameters to extract the query params. N On Mar 15, 2014 10:44 AM, "Arjun Dhar" wrote: > Hi, > for the sake of SEO. It is recommended that URL path params for a product > look like: > > Example -- > /../Category1/SubCategory2/SubSubCategory2/productDetails?name=SHOE123 > > > Now, one stupid way of doing this could be to load every product in the > database by generating the link to it. However I feel thats too > inefficient. > > I'd simply like to define a Strategy /*/productDetails?name=SHOE123 > ... Where Wicket would not care what came before "productDetails" and > recognizes "productDetails" as the Page. The PATH PARAMS are merely a SEO > formality and not of consequence to the final Page loading. > > Do I write my own strategy for this stuff or is there something Out of the > Box? > > thanks > > - > 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-tp4664984.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 > >
WildCard URL strategy for E-Commerce Products
Hi, for the sake of SEO. It is recommended that URL path params for a product look like: Example -- /../Category1/SubCategory2/SubSubCategory2/productDetails?name=SHOE123 Now, one stupid way of doing this could be to load every product in the database by generating the link to it. However I feel thats too inefficient. I'd simply like to define a Strategy /*/productDetails?name=SHOE123 ... Where Wicket would not care what came before "productDetails" and recognizes "productDetails" as the Page. The PATH PARAMS are merely a SEO formality and not of consequence to the final Page loading. Do I write my own strategy for this stuff or is there something Out of the Box? thanks - 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-tp4664984.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