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的源码

你可能感兴趣的:(jsp)