首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Struts2.x快速下手2-改进Controller Action

2012-11-10 
Struts2.x快速上手2--改进Controller Action改进Controller Action?方法一:implements Action(Interface o

Struts2.x快速上手2--改进Controller Action

改进Controller Action

?

方法一:
implements Action(Interface of xwork)


1)Login.jsp---->Logon.jsp(重新提供)
?<form action="Logon.action" method="post">


2)public class LogonAction implements Action
?execute() {
??...
??return this.SUCCESS;
??return this.ERROR;
?}

注释:阅读Action接口的源码

?

方法二:

extends ActionSupport(com.opensymphony.xwork2.ActionSupport)


1)Login.jsp---->Logon.jsp(重新提供)
?<form action="Logon.action" method="post">


2)public class LogonAction implements Action
?execute() {
??...
??return this.SUCCESS;
??return this.ERROR;
?}

注释:阅读ActionSupport的源码

热点排行