码迷,mamicode.com
首页 >  
搜索关键字:actionsupport    ( 237个结果
struts2学习笔记2 -struts2的开发步骤和工作原理
struts2的开发步骤:1.先定义一个能发送请求的页面,可以是链接,也可以是表单(form)2.开发action类,struts2对action并没有过多的要求,只要求:a 推荐实现action接口,或继承actionsupport类b 为每个请求参数都提供feild,并为之提供相应的setter...
分类:其他好文   时间:2014-10-21 21:26:42    阅读次数:193
struts之验证框架
对于格式的验证,我们可以自己写js来验证,当然struts已经封装了验证框架,下面说下我的学习哦。 验证框架分为了服务器端的验证和前台的xml配置验证(这里相当于js),下面先说下服务器端的验证。 1:由于action类继承了ActionSupport这个类,其中这个类又实现了Validateable, ValidationAware接口, 所以我们可以直接的重写validate()这个方法...
分类:其他好文   时间:2014-10-19 09:03:31    阅读次数:194
页面输入的数据格式转换类:BaseAction(常用于Struts框架中)
在我们接收页面传来的数据时,这些数据都是以String类型接收的,所以要进行数据格式转换,这时候就可以统一为它们进行转换,而且在处理这些数据的类中可以继承ActionSupport类,然后让每一个接收数据并做业务处理的action类继承该类,并调用该类中的数据格式转换方法对接收的数据进行处理。 部分关键代码如下: /**  * 超类BaseAction 数据格式转换  * @autho...
分类:其他好文   时间:2014-10-15 22:51:11    阅读次数:147
struts-没有Class会执行ActionSupport
创建项目struts2101403添加jar包commons-fileupload-1.3.jarcommons-io-2.0.1.jarcommons-lang3-3.1.jarfreemarker-2.3.19.jarjavassist-3.11.0.GA.jarognl-3.0.6.jarstruts2-core-2.3.15.1.jarxwork-core-2.3.15.1.jarsrc创建包cn.jbit.strut2101403.web.action创建实体类@Ove..
分类:其他好文   时间:2014-10-15 14:46:11    阅读次数:245
Struts2 Simple login Validate
validate()方法验证一个ACTION类继承ActionSupport有何用处?答:在ActionSupport中实现了很多接口,就拿一个来讲,validate()方法,是默认的验证。我们可以在我们的action类中重写一下此方法。比方说验证用户名是否为空。这个方法不需要调用,当S:FORM表...
分类:其他好文   时间:2014-10-08 23:40:27    阅读次数:230
struts开发<struts中的action详细配置. 二>
在eclipse中新建项目StrutsDemo1【struts的配置见】struts开发详细文件夹结构例如以下第一种配置方法新建UserActionpackage fzl.user.struts.demo;import com.opensymphony.xwork2.ActionSupport;pu...
分类:其他好文   时间:2014-10-04 13:36:36    阅读次数:261
【Struts2学习笔记(2)】Action配置中的各项默认值和Action中result的各种转发类型
一、Action配置中的各项默认值 /WEB-INF/page/hello.jsp 1>如果没有为action指定class,默认是ActionSupport。 2>如果没有为action指定method,默认执行action中的execute() 方法。 3>如果没有指定result的name属性,默认值为success。 二、Actio...
分类:其他好文   时间:2014-10-01 11:28:41    阅读次数:186
Struts2_接收参数
1.1 直接创建接收的数据类型 1 public class HelloAction extends ActionSupport { 2 3 private String name; 4 private int age;...
分类:其他好文   时间:2014-09-26 01:42:28    阅读次数:201
Struts2中的类型转换失败
类型转换失败:若 Action 类没有实现 ValidationAware 接口: Struts 在遇到类型转换错误时仍会继续调用其 Action 方法, 就好像什么都没发生一样.若 Action 类实现类 ValidationAware 接口(一般继承ActionSupport类就可以了,因为这个...
分类:其他好文   时间:2014-09-25 13:42:38    阅读次数:196
struts2的BaseAction<T>继承ActionSupport实现ModelDriven<T>
public class BaseAction extends ActionSupport implements ModelDriven { private static final long serialVersionUID = 1L; protec...
分类:其他好文   时间:2014-09-09 15:20:58    阅读次数:193
237条   上一页 1 ... 19 20 21 22 23 24 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!