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

📄 createscform.java

📁 成绩查询系统(学校期末的作业) Struts+jdbc+mysql+tomcat 开发工具为BEA WORKSHOP 功能无非就是增删查改加用户权限判断
💻 JAVA
字号:
package sfs.struts.forms;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.ValidatorForm;

import sfs.entity.Score;
import sfs.entity.io.ScoreIo;

public class CreateSCForm extends ValidatorForm {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int id;
	private String number;
	private String math;
	private String chinese;
	private String english;
	private String computer;
	private String politics;
	private String geography;
	private Score sc;
	public String getChinese() {
		return chinese;
	}
	public void setChinese(String chinese) {
		this.chinese = chinese;
	}
	public String getComputer() {
		return computer;
	}
	public void setComputer(String computer) {
		this.computer = computer;
	}
	public String getEnglish() {
		return english;
	}
	public void setEnglish(String english) {
		this.english = english;
	}
	public String getGeography() {
		return geography;
	}
	public void setGeography(String geography) {
		this.geography = geography;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getMath() {
		return math;
	}
	public void setMath(String math) {
		this.math = math;
	}
	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}
	public String getPolitics() {
		return politics;
	}
	public void setPolitics(String politics) {
		this.politics = politics;
	}
	public CreateSCForm() {
		super();
		// TODO 自动生成构造函数存根
	}
	public void reset(ActionMapping arg0, HttpServletRequest request) {
		String id=request.getParameter("id");
		
		if (id==null) {
			this.chinese = null;
			this.computer = null;
			this.english = null;
			this.geography = null;
			this.math = null;
			this.number = null;
			this.politics = null;			
		}
		
		if(id!=null&&!id.equals("0")){			
				try {
					ScoreIo scio=new ScoreIo();
					System.out.println("!!!!!!!!!!!!!!!!!!"+id);
					sc=(Score) scio.queryByid(Integer.parseInt(id)).get(0);
					this.id=Integer.parseInt(id);
					this.chinese = sc.getChinese();
					this.computer = sc.getComputer();
					this.english = sc.getEnglish();
					this.geography = sc.getGeography();
					this.math = sc.getMath();
					this.number = sc.getNumber();
					this.politics = sc.getPolitics();
				} catch (ClassNotFoundException e) {
					// TODO 自动生成 catch 块
					e.printStackTrace();
				} catch (SQLException e) {
					// TODO 自动生成 catch 块
					e.printStackTrace();
				} catch (NumberFormatException e) {
					// TODO 自动生成 catch 块
					e.printStackTrace();
				} catch (IllegalAccessException e) {
					// TODO 自动生成 catch 块
					e.printStackTrace();
				} catch (InvocationTargetException e) {
					// TODO 自动生成 catch 块
					e.printStackTrace();
				} catch (NoSuchMethodException e) {
					// TODO 自动生成 catch 块
					e.printStackTrace();
				}
				
			
		}
	}
}

⌨️ 快捷键说明

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