examOnline/src/com/action/QueryStudentByNameAction.java
(完整代码) 1002Bpackage com.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import com.entity.Student;
import com.opensymphony.xwork2.ActionSupport;
import com.service.StudentService;
import com.service.StudentServiceImpl;
/**
* 查找学生信息 -根据姓名
* @author junchuan.Wu
*
*/
public class QueryStudentByNameAction extends ActionSupport{
/**
*
*/
private static final long serialVersionUID = 1L;
private String studentName;
private StudentService studentService = new StudentServiceImpl();
public String getStudentName() {
return studentName;
}
public void setStudentName(String studentName) {
this.studentName = studentName;
}
@SuppressWarnings("static-access")
public String execute(){
HttpServletRequest request = ServletActionContext.getRequest();
List<Student> students = studentService.getStudentByName(studentName);
request.setAttribute("students", students);
return this.SUCCESS;
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。