我想从 http:// myurl 永久重定向到 https:// myurl,但在 Jetty 中我只找到 MovedContextHandler,用它我只能重定向上下文路径,例如从 myurl/bla 到 myurl/bla/bla
<Configure class="org.mortbay.jetty.handler.MovedContextHandler">
<Set name="contextPath">/bla</Set>
<Set name="newContextURL">/bla/bla</Set>
<Set name="permanent">true</Set>
<Set name="discardPathInfo">false</Set>
<Set name="discardQuery">false</Set>
</Configure>
但我该如何使用 url 前缀呢?
最好在您的处理/WEB-INF/web.xml
<web-app>
...
<security-constraint>
<web-resource-collection>
<web-resource-name>Everything in the webapp</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
</web-app>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)