- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有一个适用于 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/
我是一名优秀的程序员,十分优秀!