Spring mvc (四)

2014-11-24 11:57:17 · 作者: · 浏览: 100
*

See also the description of the workflow performed by

* {@link AbstractController the superclass} (in that section of the class
* level Javadoc entitled 'workflow').
*
*

Note: For maximum data binding flexibility, consider direct usage of a

* {@link ServletRequestDataBinder} in your controller method, instead of relying
* on a declared command argument. This allows for full control over the entire
* binder setup and usage, including the invocation of {@link Validator Validators}
* and the subsequent eva luation of binding/validation errors.
*
* @author Rod Johnson
* @author Juergen Hoeller
* @author Colin Sampaleanu
* @author Rob Harrop
* @author Sam Brannen
* @see MethodNameResolver
* @see InternalPathMethodNameResolver
* @see PropertiesMethodNameResolver
* @see ParameterMethodNameResolver
* @see org.springframework.web.servlet.mvc.LastModified#getLastModified
* @see org.springframework.web.bind.ServletRequestDataBinder
*/
public class MultiActionController extends AbstractController implements LastModified {
....
里面的信息我们就不贴出来了,我们是看注释里面给我们说明继承他后的方法,行吧,这里我就不多说了,把 TestVO 对象代码也贴下吧,免得有人问 TestVO 是什么呢,如下:
[java]
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.lap.taobaouse.controller;
import java.io.Serializable;
/**
*
* @author 劳水生 Exp
* @version $FileName: TestVO.java $Date: 2013-3-21 上午9:50:36 -0400 2013
* @since 1.0
*
*/
public class TestVO implements Serializable {
private static final long serialVersionUID = 7868977600979801437L;
/**
* id
*/
private int id;
/**
* 用户姓名
*/
private String name;
/**
* 性别
*/
private int sex;
/**
* 动物猫数据对象
*/
private CatVO catVO;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getSex() {
return sex;
}
public void setSex(int sex) {
this.sex = sex;
}
public CatVO getCatVO() {
return catVO;
}
public void setCatVO(CatVO catVO) {
this.catVO = catVO;
}
}
为了证明类内聚合对象也能提交,我在TestVO 里面还搞了一个 CatVO,这里也贴出来吧,如下:
[java]
/*
* Copyright 2013 The JA-SIG Collaborative. All rights reserved.
* distributed with this file and available online at
* http://www.etong.com/
*/
package com.lap.taobaouse.controller;
import java.io.Serializable;
/**
*
* @author 劳水生 Exp
* @version $FileName: CatVO.java $Date: 2013-3-21 下午2:00:54 -0400 2013
* @since 1.0
*
*/
public class CatVO implements Serializable {
private static final long serialVersionUID = 2015266440849396264L;
/**
* 动物名称
*/
private String name;
public String getName() {
return name;
}
public void setName(String name) {
th