wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Forchel <dirk.forc...@exedio.com>
Subject Re: Redirect to Wicket page with 301 Moved Permanently
Date Thu, 17 Jan 2013 13:06:53 GMT
Hm, I already thought about that. But I miss the link between the old mounted
pages and the new pages. I mean I have to mount a pair of page classes

mountPage("product.html", LegacyProductPage.class);
mountPage("product/#{product_name}/${product}", ProductPage.class)

And in the new Mapper would check like (don't know whether this works):

public final IRequestHandler mapRequest(Request request)
   IRequestHandler handler = delegate.mapRequest(request);
   // check whether the request is a legacy URL
   if (isLegacyUrl(request)
      // get the new URL instead
      String url = createRedirectUrl(handler, request);
      handler = createRedirectHandler(url);
   return handler 

Just what I have in mind. The new mapper would hold a map with a pair of
"legacy" and "new" Page classes. And for each request the mapper would check
whether this request URL is contained in the map. But this means I have to
maintain two places for each pair of "legacy" and "new" Page classes. I'm
not sure whether this is a smart solution. 

View this message in context: http://apache-wicket.1842946.n4.nabble.com/Redirect-to-Wicket-page-with-301-Moved-Permanently-tp4631888p4655465.html
Sent from the Users forum mailing list archive at Nabble.com.

To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org

View raw message