开发者

Any better way to handle legancy URLs in J2ee than URLRewrite

开发者 https://www.devze.com 2023-02-24 02:08 出处:网络
How should I handle large set of legacy urls and URL aliases in J2EE. I can\'t use wildcard mapping for the urls as they are provided by hand by the users of my application so there is no enforced ur

How should I handle large set of legacy urls and URL aliases in J2EE.

I can't use wildcard mapping for the urls as they are provided by hand by the users of my application so there is no enforced url schema开发者_运维问答.

If I use URLRewrite with every single URL as a separated mapping I'll get something that at least in a theory will be quite slow O(n).

Should I create my own filter that will maintains the mapping as a dictionary so that I get O(log(n)) complexity?

Or maybe the URLRewrite is smart enough to use a proper tree for urls that do not use wildcards?


I've created a custom URLRewriteFilter rule that look for the aliases in a dictionary. The only problem is that it does not recognize URL transformations done by preceding rules. This is due to limitation of class-rules in URLRewriteFilter.

But apart of that it works pretty well and was quite quick to create

0

精彩评论

暂无评论...
验证码 换一张
取 消