主流开源框架第一部分---Struts(一).pptVIP

  • 0
  • 0
  • 约6.89千字
  • 约 57页
  • 2018-04-26 发布于江苏
  • 举报
主流开源框架第一部分---Struts(一)

章节目录 Action接口 Action类的方法 Action的调用 Action接口 Struts2中的Action不需要实现任何接口 Struts2的API中提供了com.opensymphony.xwork2.Action接口,接口中提供了常量以及execute方法 Action类可以实现Action接口 Action类中的方法 默认情况下,Action类的方法必须符合如下声明形式 public String execute() throws Exception { } Action类的方法名字可以不是execute,但是必须在struts.xml中进行指定 action name=Register class=com.etc.action.RegisterAction method=register “合并”多个Action类 可以在一个Action中声明多个方法,如login、register等,必须在struts.xml中进行配置 action name=Customerlogin class=com.etc.action.CustomerAction method=login result name=success/welcome.jsp/result result name=fail/index.jsp/result /action action name=C

文档评论(0)

1亿VIP精品文档

相关文档