📄 findthreadform.java
字号:
/* * XP Forum * * Copyright (c) 2002-2003 RedSoft Group. All rights reserved. * */package org.redsoft.forum.web;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionError;import org.apache.struts.action.ActionErrors;import org.apache.struts.action.ActionMapping;import javax.servlet.http.HttpServletRequest;/** * Form bean for find thread screen. * <ul> * <li><b>title</b> - Entered title value * <li><b>content</b> - Entered content value * </ul> * * @@author <a href="mailto:chjxm@msn.com">cinc</a> * * @@version $Id: FindThreadForm.java,v 1.1.1.1 2004/02/04 03:52:13 mustang Exp $ * */public class FindThreadForm extends ActionForm { private String query; private String type; public String getQuery(){ return query; } public String getType(){ return type; } public void setQuery(String query){ this.query = query; } public void setType(String type){ this.type = type; } /** * Validate the properties that have been set from this HTTP request, * and return an <code>ActionErrors</code> object that encapsulates any * validation errors that have been found. If no errors are found, return * <code>null</code> or an <code>ActionErrors</code> object with no * recorded error messages. * * @param mapping The mapping used to select this instance * @param request The servlet request we are processing */ public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if ( query != null ) { query = query.trim(); } if ( (query==null) || (query.length()<1) ){ errors.add ("query", new ActionError("error.query.required")); } if ( (type==null) || (type.length()<1) ){ errors.add ("type", new ActionError("error.type.required")); } return errors; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -