⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 findthreadform.java

📁 如题ServletJSP.rar 为网络收集的JSP网站源文件
💻 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 2003/07/08 08:25:17 cinc 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();
        query = query.trim();
        if ( (query==null) || (query.length()<1) ){
        	errors.add ("query", new ActionError("error.query.required"));
        }
        return errors;

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -