tjg184 / urlrewritefilter

Automatically exported from code.google.com/p/urlrewritefilter
Other
0 stars 0 forks source link

Enhancement request to add <outbound-class-rule> for custom URI localization #73

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

We use the following rule to map localized URI's to canonical URI's and it 
works great:
     <class-rule class="org.test.ext.urlrewritefilter.rule.LocalizedToCanonicalUrlRule"
method="matches" />

Essentially the class loads resource bundles for a given locale which provide 
mappings of localized URI segments to canonical mappings... essentially 
reconstructing a canonical URI on every request.

Sure - we could in cases were we have say:
     <%=response.encodeURL("/member/1234") %>

Have instead something like:
     <%=LocalizedUrlToCanonical.map(response.encodeURL("/member/
1234")) %>

But that means we need to explicitly apply localization on every outbound URL 
strewn throughout our HTML / JSP markup and that just doesn't seem right if you 
consider that  response.encodeURL("...")  is processed by UrlRewriteFilter in 
one place with outbound-rules.

What is really needed is a custom class essentially do the reverse for all 
URI's during their encoding but the syntax / functionality is not there:
     <outbound-class-rule
class="org.test.ext.urlrewritefilter.rule.CanonicalToLocalizedUrlRule"
method="matches" />

UrlRewriteFilter should be enhanced to support an <outbound-class-rule>.

--Nikolaos

Original issue reported on code.google.com by ngs...@gmail.com on 24 Jun 2010 at 8:45

GoogleCodeExporter commented 9 years ago
Hello,

we also would like to have this feature to have more flexibility in creating 
"dynamic" outbound rules.

Thank you in advance!

Kind regards
Sergiy Shyrkov

Original comment by Sergiy.Shyrkov on 1 Mar 2011 at 2:17

GoogleCodeExporter commented 9 years ago

Original comment by p...@tuckey.org on 25 Jun 2012 at 2:17

GoogleCodeExporter commented 9 years ago
Yes, I completely agree. I'd love to have this too! Without it, we're stuck.

Original comment by vmas...@gmail.com on 20 Apr 2015 at 11:08