Struts2 redirecting to another action with unknown amount of parameters

谁说我不能喝 提交于 2019-11-30 10:33:00

You can save action name, namespace, and parameters from the ActionMapping.

ActionMapping mapping = ServletActionContext.getActionMapping();

You can also save query string instead of parameter map.

String params = request.getQueryString();

To add parameters dynamically to redirectAction result you should use OGNL in a dynamic parameter.

<param name="actionName">${previousAction.name +'?'+ parameters}</param>

Supposed you have a getter for parameters and initialized it from session where you saved previous query string, action name, and namespace.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!