实现action的三种方法
1.一个普通的类
public class testAction1 {
public String execute(){
return "success";
}
}
2.实现Action接口
public class testAction2 implements Action {
@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
return SUCCESS;//这个时候可以用SUCCESS,因为Action接口中有SUCCESS
}
}
3.继承ActionSupport类
public class testAction3 extends ActionSupport {
public String execute() throws Exception{
return SUCCESS;//ActionSupport接口实现了Action类
}
}
实现action的三种方法的更多相关文章
- struts2开发action 的三种方法以及通配符、路径匹配原则、常量
struts2开发action 的三种方法 1.继承ActionSupport public class UserAction extends ActionSupport { // Action中业务 ...
- 写Action的三种方法
Action类似于servlet,在用户对浏览器输入url访问的时候充当控制器的角色.它在访问时产生,执行execute()之后就销毁了. 写Action是代理事务,它实现的三种方式是: (1)POJ ...
- struts 中的创建Action的三种方法
1.对于直接创建类,不实现接口和继承任何的类 例如创建一个helloAction package cn.lonecloud.control; import com.opensymphony.xwork ...
- struts2中的jsp值传到后台action接收的三种方法
struts2中的Action接收表单传递过来的参数有3种方法: 如,登陆表单login.jsp: <form action="login" method="pos ...
- jsp值传到后台Struts2中的action三种方法
Action接收表单传递过来的参数有3种方法: 如,登陆表单login.jsp: <form action="login" method="post" n ...
- struts2 Action 接收参数的三种方法
刚学Struts2 时 大家可能遇到过很多问题,这里我讲一下Action 接收参数的三种方法,我曾经在这上面摔过一回.所以要警醒一下自己..... 第一种:Action里声明属性,样例:account ...
- struts2的action访问servlet API的三种方法
学IT技术,就是要学习... 今天无聊看看struts2,发现struts2的action访问servlet API的三种方法: 1.Struts2提供的ActionContext类 Object g ...
- Action访问Servlet API的三种方法
一.为什么要访问Servlet API ? Struts2的Action并未与Servlet API进行耦合,这是Struts2 的一个改良,从而方便了单独对Action进行测试.但是对于Web控制器 ...
- ASP.NET MVC 中将数据从View传递到控制器中的三种方法(表单数据绑定)
http://www.cnblogs.com/zyqgold/archive/2010/11/22/1884779.html 在ASP.NET MVC框架中,将视图中的数据传递到控制器中,主要通过发送 ...
随机推荐
- [转]Google2012.9.24校园招聘会笔试题
代码: [cpp] view plaincopy //转载请标明出处,原文地址:http://blog.csdn.net/hackbuteer1/article/details/8017703 boo ...
- C#Http编程
c# 模拟 网页实现12306登陆.自动刷票.自动抢票完全篇(转) 这一篇文章,我将从头到尾教大家使用c#模拟网页面登陆12306网站,自动刷票,选择订票人,到最后一步提交订单.研究过HTTP协议的童 ...
- python标准库 sysconfig模块
# -*- coding: utf-8 -*-# python:2.x__author__ = 'Administrator'import sysconfig#sysconfig:解释器编译时配置#作 ...
- SpringMVC(一)——流程框架总体介绍
SpringMVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面.Spring 框架提供了构建 Web 应用程序的全功能MVC 模块,其功能和Strtus2 ...
- Laravel 安装指南
http://www.golaravel.com/article/laravel-installation-guide/ http://laravel.com/api/4.1/ http://ding ...
- 原生Javascript实现图片轮播效果
首先引入js运动框架 function getStyle(obj,name){ if(obj.currentStyle){ return obj.currentStyle[name]; } else{ ...
- Java的String&StringBuffer&StringBuilder
一:String类 1.String对象的初始化 由于String对象特别用,所以在对String对象进行初始化时,Java提供了一种简化的特殊语法,格式如下: String s = "ab ...
- 段的创建表user_segments
1.段的定义及类型 Oracle中的段(segment)是占用磁盘空间的一个对象,最常见的段类型包括: l 聚簇cluster l 表table l 表分区 tablepartition l ...
- 自动运行native2ascii 命令的Bat文件的编写
使用eclipse开发,对于.properties文件的国际化,如果不使用插件对文件进行转码,则需要使用native2ascii命令自行对文件进行转码. 为了更方面的执行此操作,我将该 ...
- [原]C++关于运算符重载的程序报错error…
错误信息如下: 1>t2.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall Date::Date(void)" (??0D ...