struts2携带参数提交请求

来源:百度知道 编辑:UC知道 时间:2024/05/31 21:54:53
在struts1.2中可以通过 <a href="hello.do?menthod=dosomething¶m=a"/>
&的形式传递参数!
请问在 struts 2中怎么实现?
可以实现吗?
hello!haha.action¶m=***
这样的...........................
谢谢各位大侠!

<a href='<s:url action="hello-a"></s:url>'>

在struts.xml中加入如下内容
<action name="hello-*" class="com.test.action.TestAction">
<param name="m">{1}</param>
<result>/success.jsp</result>
</action>

就可以讲“a”传递给参数m

与struts1.2一样的
hello!xxx.action?param1=abc¶m2=bcd....

可以的。