gpt4 book ai didi

url - Websphere 8.5.5 中不会出现重定向到带有尾部斜杠的 URL

转载 作者:行者123 更新时间:2023-12-02 09:13:46 25 4
gpt4 key购买 nike

有一个适用于 WAS7 的应用程序。它在上下文路径“Foo/Bar”(复合一)上部署了 war 模块。也就是说,war 模块可以通过如下 URL 访问:localhost:9080/Foo/Bar。

然后我在 WAS 8.5.5 上部署了相同的应用程序。尝试使用相同的 URL localhost:9080/Foo/Bar (没有尾部斜杠)访问 war 模块,并获取没有检索到 css 和 js 文件的“裸”页面。但是,当我尝试通过以下 URL localhost:9080/Foo/Bar/(带有尾部斜杠)访问模块时,CSS 和 js 会被正确拾取。

到目前为止,我能弄清楚的是,在 WAS 7 上一切正常,因为从不带尾部斜杠的 URL 重定向到带尾部斜杠的 URL。这似乎是正常行为 http://webdesign.about.com/od/beginningtutorials/f/why-urls-end-in-slash.htm 。问题是为什么我在 WAS 8.5.5 上没有相同的行为?有什么办法可以配置吗?

最佳答案

使用记录于 WAS9 Custom Properties

com.ibm.ws.webcontainer.redirectcontextroot

If set to true, and a request is made to the context root of an application with a missing trailing slash, the WebContainer appends the trailing slash. The WebContainer redirects to the URL with the appended slash before it applies any servlet filters defined in the application.

For example, a request to http://host:port/contextRoot is redirected to http://host:port/contextRoot/ before any filters are applied.

Name: com.ibm.ws.webcontainer.redirectcontextroot, Default value: false

关于url - Websphere 8.5.5 中不会出现重定向到带有尾部斜杠的 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23265719/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com