标签:
<struts> <constant name="struts.devMode" value="true" /> <package name="user" extends="struts-default" namespace="/user"> //方法一 <action name="userAdd" class="com.struts2.user.action.UserAction" method="add"> <result>/user_add_success.jsp</result> </action> //方法二 <action name="user" class="com.struts2.user.action.UserAction"> <result>/user_add_success.jsp</result> </action> </package> </struts><span style="font-family: Arial, Helvetica, sans-serif;"> </span>
package com.bjsxt.struts2.user.action; import com.opensymphony.xwork2.ActionSupport; public class UserAction extends ActionSupport { public String add() { return SUCCESS; } }
调用方法:http://localhost:8080/Struts2_0500_ActionMethod//user/userAdd
版权声明:本文博客原创文章,博客,未经同意,不得转载。
【web开发学习笔记】Structs2 Action学习笔记(两)
标签:
原文地址:http://www.cnblogs.com/bhlsheji/p/4665322.html