If you are referring to the balancer documentation, does it mean that you have Apache in front already? If so, just use mod_rewrite, otherwise read on.
Normally these things are implemented using ServletFilters, but that is part of your webapp and you said want configuration-only option.
Unfortunately, there is no valve (yet) which does what you need, but at least existing ones could be used for reference. It should be quite trivial, see its API (hint: look at invokemethod).
发布评论
评论(1)
如果您指的是平衡器文档,是否意味着您已经拥有 Apache 了?如果是这样,只需使用
mod_rewrite
,否则继续阅读。通常这些东西是使用 ServletFilter 实现的,但这是您的 web 应用程序的一部分,并且您说需要仅配置选项。
另一种选择是编写一个 Valve 并将其添加到配置中。以下是标准 Tomcat 阀门的列表:
http://tomcat.apache.org/tomcat-5.5-doc/config /valve.html
不幸的是,目前还没有可以满足您需要的阀门,但至少现有的阀门可以供参考。它应该非常简单,请参阅 它的 API(提示:查看
invoke
方法)。If you are referring to the balancer documentation, does it mean that you have Apache in front already? If so, just use
mod_rewrite
, otherwise read on.Normally these things are implemented using
ServletFilter
s, but that is part of your webapp and you said want configuration-only option.Another alternative would be to write a
Valve
and add it to the configuration. Here's the list of standard Tomcat valves:http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html
Unfortunately, there is no valve (yet) which does what you need, but at least existing ones could be used for reference. It should be quite trivial, see its API (hint: look at
invoke
method).