Chinaunix首页 | 论坛 | 博客
  • 博客访问: 327361
  • 博文数量: 96
  • 博客积分: 2041
  • 博客等级: 大尉
  • 技术积分: 1080
  • 用 户 组: 普通用户
  • 注册时间: 2012-01-20 14:08
文章分类

全部博文(96)

文章存档

2015年(2)

2013年(1)

2012年(93)

分类: 系统运维

2012-01-20 14:24:26

struts2也支持自定义方法,即在struts.xml中的action元素内自定义method属性,属性值即为待执行的方法。其中,该方法的声明要与xxexecute保持一致。但是不推荐使用这种方式,因为它容易导致Action代码混乱。

struts2.xml

<action name = "login" class = "com.shengsiyuan.struts2.LoginAction" method = "myExecute">

           <result name = "SUCCESS">/result.jsp result>

       action>

修改之后,就不再调用execute(),而直接调用myExecute()方法。

 

 

阅读(709) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~