我正在制作这个小应用程序来练习SpringMVC,但我不断收到此错误。我想知道是否有人可以指出我做错了什么。我看到这个错误来自EmployeeDao.jsp,但我不知道我做错了什么,或者是什么导致了这个错误。我感谢任何建议。
针对home.jsp
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="false" %>
<html>
<head>
<title>Home of XYZ Inc.</title>
</head>
<body>
<h1>
Welcome to my XYZ Inc company.
</h1>
<P> <a href="viewEmployee">View All Employee</a> </P>
</body>
</html>
EmployeeDao.java
public List<Employee> getAllEmployee(){
List<Employee> employees;
employees = new ArrayList<Employee>();
try {
Statement statement;
statement = connection.createStatement();
ResultSet rset = statement.executeQuery("select * from Employees");
while(rset.next()) {
Employee employee = new Employee();
employee.setEmployeeId(rset.getInt("employeeId"));
employee.setName(rset.getString("name"));
employee.setTittle(rset.getString("tittle"));
employee.setHourlyWage(rset.getString("hourlyWage"));
employee.setTotalHour(rset.getString("totalHour"));
employees.add(employee);
}
}catch(SQLException e) {
e.printStackTrace();
}
return employees;
}
HomeController.java
@RequestMapping("/viewEmployee")
public ModelAndView viewEmployee() {
List<Employee> list = dao.getAllEmployee();
return new ModelAndView("viewEmployee", "list", list);
}