- 浏览: 27428 次
- 性别:
- 来自: 潍坊
最新评论
-
赤木晴子:
垃圾 没有jar包
struts2 velocity -
duronshi:
弱弱问下,如果我不用struts的标签<s:form而用 ...
struts2 基本校验 -
java_vm:
hyx0914 写道呵呵,这样写的话为什么不在前台页面就验证了 ...
struts2 基本校验 -
hyx0914:
呵呵,这样写的话为什么不在前台页面就验证了呢?
struts2 基本校验 -
chrislee1982:
还用这种方式验证?难道不知道可以使用xml配置或者annota ...
struts2 基本校验
文章列表
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
public class ExampleInterceptor extends AbstractInterceptor {
//重写抽象拦截器的拦截方法
@Override
public String intercept(ActionInvocation arg0) throws Exception { ...
Type类型值
作用说明
对应类
chain
用来处理Action链
= Action类中ActionSupport使用以及validate方法重写实现。
= 属性文件messageResource.properties定义以及JSP页面上错误信息如何显示。
= 导航结果页面演示。
public class LoginAction extends ActionSupport {
//校验方法,用来校验输入值为空或没有输入返回错误信息
public void validate() {
if (getUsername() == null || getUsername().trim().equals(&quo ...
开发所必备的基本jar包:
struts2-core-2.1.6.jar :开发的核心类库freemarker-2.3.13.jar :struts2的UI标签的模板使用freemarker编写commons-logging-1.0.4.jar :日志包ognl-2.6.11.jar :对象图导航语言,通过它来读写对象属性xwork-2.1.2.jar :xwork类库,struts2在其上进行构建