?? answeraction.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 + -