我正在开发一个项目,让我们用新的struts 2应用程序替换旧的struts 1应用程序.但是,我们新的Struts 2应用程序需要与许多其他业务应用程序一起使用,这些应用程序希望使用相同的URL调用应用程序.所以,会有像这样的链接
businessApplication /视图/ getById.do?ID = XXXXXXXXXX
我们的新应用程序不使用后缀(但是,您可以选择指定.action后缀)而不是.do后缀.我想要做的是捕获那些旧的URL(带有.do后缀)并转发到适当的操作,例如:
businessApplication /视图/ findById?编号= XXXXXXXX
但是,我找不到用.do后缀捕获任何东西的方法.我尝试将动作名称设置为getById.do和getById*无效.
有任何想法吗?
谢谢!
我在最佳答案中找到了我的答案:web.xml filter-mapping不转发到struts
这是我添加到我的struts.xml中的内容
<!-- FOR COMPATIBILITY WITH EXTERNAL APPLICATIONS
This constant allows actions with the suffixes of "", ".action", or ".do". This allows the creation of actions ending in .do, to allow external applications
that may be looking for .do actions to still use this app without any changes. -->
<constant name="struts.action.extension" value=",action,do" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2869 次 |
| 最近记录: |