还有mapper:
<mapper namespace="yuhantao">
<insert id="insertStudent" parameterType="yuhantao.Students" useGeneratedKeys="true" keyProperty="id">
insert into students_information (name,Gender,Major,Grade,Address,Telephone,time,create_date)
values (#{name},#{Gender},#{Major},#{Grade},#{Address},#{Telephone},#{time},#{create_date})
</insert>

<select id="selectStudent" parameterType="int" resultType="Students">
select * from students_information where id=#{id}
</select>
</mapper>

解决方案 »

  1.   

    代码看了一半:提出我的疑问:1、你的问题是什么?错误又是什么?  是Student没有传入值? 还是某个对象为空?2、如果是对象为空,那就一步步调试。  如果是没有传入值,或者Student某个字段传入报错,那就看看是那个字段,如果是int,改为Integer
      

  2.   

    action里用的是对象,页面就应该是student.name,student.gender之类的属性。
      

  3.   

    如果你用的是struts2框架,可以参考他的ognl机制。
    http://blog.csdn.net/jelly_8090/article/details/8129529 这个例子不知道可否满足你的需求。
      

  4.   

    用struts的ModelDriven就可以实现了,在input里面的name="student.(这里输入你的名称就行)",action继承 ModelDriven<实体类>