当部署为 ROOT.war 时,让 struts s:url includeparams 在 jboss 上工作
我正在开发一个使用 struts 2、spring、URL 重写过滤器 和我不确定与此相关的其他几个依赖项。 我们构造的 url 之一的构造如下:
<s:url id="blah" includeParams="get">
当在 jboss 中部署时,作为普通的 web 应用程序放入部署/中,这可以正常工作。 那么所有网址的形式都是 http://localhost:8080/mywebapp/...使用此标签,所有获取参数都会按预期包含在内。
然而,我们希望在根上下文中部署此代码(因此所有内容最终都位于 http://localhost:8080/.. .),因此我们将其部署为 ROOT.war。 突然,所有的 get 参数都不再出现在 URL 中。 我已经寻找了一段时间,似乎无法弄清楚可能导致此问题的原因。 首先我以为这与 URL 重写有关,但它似乎工作正常。 欢迎提供任何提示、指示、进一步的问题以供澄清。 更令人困惑的是,当部署在jetty中时(根上下文是默认的),这一切也可以正常工作。
编辑:我还尝试删除 ROOT.war 并使用 jboss-web.xml 部署到根上下文,但这表现出了完全相同的问题。
I'm working on a webapp that uses struts 2, spring, URL Rewrite Filter and a couple of other dependencies that I'm not sure are relevant to this. One of the url's we construct is constructed as follows:
<s:url id="blah" includeParams="get">
This works fine when deploying in jboss as a normal webapp dropped in deploy/. So then all urls are of the form http://localhost:8080/mywebapp/... and when using this tag all the get parameters get included as expected.
However we wish to deploy this code in the root context (so everything ends up under http://localhost:8080/...), so we deployed it as ROOT.war. Suddenly, all the get parameters no longer show up in the URL. I've been looking for a while and can't seem to figure out what might cause this. First I thought it was to do with the URL rewriting but it seems to be working fine. Any tips, pointers, further questions for clarification are welcome. To add to the confusion, this all also works fine when deployed in jetty (where root context is the default).
edit: I've also tried removing ROOT.war and using jboss-web.xml to deploy to root context, this exhibits the exact same problem though.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将此部分归因于 url 重写配置错误,获取参数未添加到要重写的 url 中,因为 urlrewrite 上的“include-query-string”未设置为 true。 这意味着“blah?querystring”不会被重定向到“blah.action?querystring”。 由于相互关联的问题,它现在似乎仍然不起作用,但我将把它们分开到另一个问题。
I tracked this partly down to the url rewriting being misconfigured, the get parameters weren't being added to the urls to be rewritten because 'include-query-string' wasn't set to true on urlrewrite. this meant that 'blah?querystring' wasn't being redirected to 'blah.action?querystring'. It still doesn't seem to work right now because of interrelated problems, but I will separate those out to another question.