【Java开源代码栏目提醒】:网学会员鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“ArchiveListForm.java”一文,供大家参考学习
/*
*
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
*
*/
package com.stsc.archive.backup;
import java.text.ParseException;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import java.util.Date;
/**
* Form bean for the archive page. This form has the following fields,
* @author Yushirui
* @version $Revision: 1.0 $ $Date: 2003/04/14 10:42:08 $
*/
public final class ArchiveListForm extends ActionForm {
private String serialno = null;
private String temp = null;
private String action = null;
private String backupFilename = "";
public void setBackupFilename(String backupFilename)
{
this.backupFilename = (backupFilename==null)?"":backupFilename;
}
public String getBackupFilename()
{
return this.backupFilename;
}
// ----------------------------------------------------------- Properties
/**
* Return the action.
*/
public String getAction() {
return (this.action);
}
/**
* Set the action.
*
* @param action The new action
*/
public void setAction(String action) {
this.action = action;
}
/**
* Return the serialno.
*/
public String getSerialno() {
return (this.serialno);
}
/**
* Set the serialno.
*
* @param serialno The new serialno
*/
public void setTemp(String temp) {
this.temp = temp;
}
public String getTemp() {
return (this.temp);
}
/**
* Set the serialno.
*
* @param serialno The new serialno
*/
public void setSerialno(String serialno) {
this.serialno = serialno;
}
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request)
{
ActionErrors errors = new ActionErrors();
if((backupFilename == null) || (backupFilename.length() < 1))
{
errors.add("backupFilename", new ActionError("error.backup.backupFilename"));
}
//简单验证,没考虑大小写问题
else if(backupFilename.indexOf(".xml") == -1)
{
backupFilename += ".xml";
}
return errors;
}
}
上一篇:
ArchiveListAction.java
下一篇:
白色姜花,略微开了