struts2访问自定义action方法

1.直接在连接中使用!method的方法

如:

http://localhost:8080/webname/show.action!showmessage?name=ru&age=23


//?后面为要传递参数,!后面为action的方法

2.在struts.xml配置文件中配置method属性

<action name="mymethod" class="com.ru.action.InterceptorAction" method="method">


猜你喜欢

转载自tydldd.iteye.com/blog/1720186