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

📄 answeraction.java

📁 在线考试系统
💻 JAVA
字号:
/**
 * 
 */
package exam.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import exam.dao.StudentAnswerTable;
import exam.dao.User;



/**
 * @author huaying_livingbdoy
 *
 */
public class Answeraction extends ActionSupport {
private StudentAnswerTable studentAnswerTable;

public StudentAnswerTable getStudentAnswerTable() {
	return studentAnswerTable;
}

public void setStudentAnswerTable(StudentAnswerTable studentAnswerTable) {
	this.studentAnswerTable = studentAnswerTable;
}

public String execute(){
	System.out.println("**********");
	StudentAnswerTable dao=new StudentAnswerTable();
	List list=dao.findLogin(studentAnswerTable.getOneaskanswer(), studentAnswerTable.getClass());
	if(list.size()==1){
		studentAnswerTable=(StudentAnswerTable)list.get(0);
		ActionContext context = ActionContext.getContext();
		HttpServletRequest req = (HttpServletRequest) context
				.get(ServletActionContext.HTTP_REQUEST);
		HttpSession session = req.getSession();
		session.setAttribute("action",studentAnswerTable);
	}
	return SUCCESS;
}


	


}

⌨️ 快捷键说明

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