admin管理员组文章数量:1405297
My tomcat process has -DcontextName=companyApp but I am unable to use this in my urlrewrite.xml file
<?xml version="1.0" encoding="utf-8"?>
<!--
Configuration file for UrlRewriteFilter
/
-->
<urlrewrite use-query-string="true" default-match-type="wildcard">
<rule>
<from>${contextName}</from>
<to type="permanent-redirect" last="true">abc</to>
</rule>
</urlrewrite>
the redirect does not work. I think the ${contextName} is not getting resolved.
Note that I have set default-match-type="wildcard"
to remove any doubts about any clash with regex engine.
Edit: I also tried to use %{context-path}, which is a variable provided by url rewrite filter, to do the same job but that did not work either, which is why I am using this approach.
本文标签: javaHow to use environment variable in urlrewritexmlStack Overflow
版权声明:本文标题:java - How to use environment variable in urlrewrite.xml? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744909687a2631838.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论