/** @todo: finish this method, this is just the skeleton.*/ ActionErrors errors = null; if (this.findByKey.equals("") this.findByValue.equals("")) { errors = new ActionErrors(); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("find.jsp.error")); } return errors; }
public void reset(ActionMapping actionMapping, HttpServletRequest servletRequest) { } } /**/ package com.bookshop.form;
import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionMapping; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionError;
public class OperatorForm extends ActionForm { private String operator; public String getOperator() { return operator; }
public void setOperator(String operator) { this.operator = operator; }
public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { ActionErrors errors = new ActionErrors(); if (httpServletRequest.getParameter("operator") != null) { String lang = httpServletRequest.getParameter("operator"); /* if ( (lang.length() < 6) (lang.length() > 6)) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("index.jsp.operator.error")); } */ } else { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("index.jsp.operator.null"));
复制本页网址和标题,发送给你QQ/Msn的好友一起分享
上一篇:JBuilder2005实战JSP之特殊页面
下一篇:JSP数据库操作例程