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

📄 addprojectform.java

📁 使用JSP+Servlet+Hibernate+Struts实现的一个学生软件发布平台
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package edu.neu.sspp.struts.form;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/** 
 * MyEclipse Struts
 * Creation date: 06-19-2007
 * 
 * XDoclet definition:
 * @struts.form name="addProjectForm"
 */
public class AddProjectForm extends ActionForm {
	/*
	 * Generated fields
	 */

	/** file property */
	private String file;

	/** name property */
	private String name;

	/** intro property */
	private String intro;

	/*
	 * Generated Methods
	 */

	/** 
	 * Method validate
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		// TODO Auto-generated method stub
		ActionErrors error = new ActionErrors();
		if(name == null || name.equals(""))
			error.add("name", new ActionMessage("error.project.name.null"));
		if(intro.length() > 1024)
			error.add("intro", new ActionMessage("error.project.intro.error"));
		if(false)
			error.add("file", new ActionMessage("error.project.file.xxxx"));
		
		try {
			convertToUTF();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return error;
	}

	/** 
	 * Method reset
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		// TODO Auto-generated method stub
	}

	/** 
	 * Returns the file.
	 * @return String
	 */
	public String getFile() {
		return file;
	}

	/** 
	 * Set the file.
	 * @param file The file to set
	 */
	public void setFile(String file) {
		this.file = file;
	}

	/** 
	 * Returns the name.
	 * @return String
	 */
	public String getName() {
		return name;
	}

	/** 
	 * Set the name.
	 * @param name The name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/** 
	 * Returns the intro.
	 * @return String
	 */
	public String getIntro() {
		return intro;
	}

	/** 
	 * Set the intro.
	 * @param intro The intro to set
	 */
	public void setIntro(String intro) {
		this.intro = intro;
	}
	
	private void convertToUTF() throws IOException {
		name = new String(name.getBytes("ISO-8859-1"), "UTF-8");
		intro = new String(intro.getBytes("ISO-8859-1"), "UTF-8");
		file = new String(file.getBytes("ISO-8859-1"), "UTF-8");
	}
}

⌨️ 快捷键说明

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