published : 2013-10-26
updated : $Date: 2013-11-16 23:36:15 +0900 (Sat, 16 Nov 2013) $
According to Issue120 in UrlRewriteFilter, It does not work properly if you set 2 or more sequential function. So, I fixed it. I have send the patch to project already. And I'll publish the patch and compiled jar in this page. Anyone who is annoyed by this issue, I hope you check it.
I created patch-Issue120-fixed.txt by executing svn diff > patch.txt
after code fixed and tested.
If you hope, you can check modification after you get all code of urlrewritefilter and apply this patch.
Refer the url below to see all code of UrlRewriteFilter
https://code.google.com/p/urlrewritefilter/source/checkout
UrlRewriteFilter is the library. You can make application treats request of a url as the request of another url. This library will rewrite url and pass it to application. You can serve freely designed beautiful url and use default url pattern of web framework (Apache Struts and so on) which is not so beautiful. For example, suppose you want to publish the url below.
http://example.org/repo/data/123/foobarbaz
But, the framework might have url just like below
http://example.org/repo/data/get.do&id=123
In case of this, UrlRewriteFilter is useful. Because this rewrites url just like this.
According to Issue120,
if Function in <to>
element
is sequential, it does not work properly. For Example,
/test/${upper:$1}/${upper:$1}.html
With this setting, open curly bracket and end curly bracket does not parsed correctly.(This is treated as containts only one function. outside "${" and "}" will be treated as one function.) This patch will solve this situation. Even if many function is used , sequentially or nested, This will work fine and as you expected.
The slide below is presentation about this patch in #shibuya-Java 4th. In Japanese.
This document is licenced by
Attribution 2.1 Japan (CC BY 2.1)