基本上学完了,给准备和老师敲代码的小伙伴一个建议,最好要和老师用的版本一样,不然会出现很多bug,而且bug基本上也是在后面,不是很好解决,前面的小bug不算,打击信心,方然大神就可以笑一笑了。
birthday = DateFormatter.parse(request.getParameter("birthday"));
students.setBirthday(birthday);
} catch (Exception e) {
e.printStackTrace();
}
students.setAddress("address");
sDao.addStudents(students);
return "add_success";
}
<result name="add_success">/students/Students_add_success.jsp</result>
students.setBirthday(birthday);
} catch (Exception e) {
e.printStackTrace();
}
students.setAddress("address");
sDao.addStudents(students);
return "add_success";
}
<result name="add_success">/students/Students_add_success.jsp</result>
2017-07-04
public String add(){
StudentsDAO sDao=new StudentsDAOImpl();
Students students=new Students();
students.setSname(request.getParameter("sname"));
students.setGender(request.getParameter("gender"));
DateFormat DateFormatter = new SimpleDateFormat( "yyyy-MM-dd");
Date birthday;
try {
StudentsDAO sDao=new StudentsDAOImpl();
Students students=new Students();
students.setSname(request.getParameter("sname"));
students.setGender(request.getParameter("gender"));
DateFormat DateFormatter = new SimpleDateFormat( "yyyy-MM-dd");
Date birthday;
try {
2017-07-04