The given object has a null identifier解决之法

          今天在做毕业实际的过程,报如下异常:

org.springframework.dao.InvalidDataAccessApiUsageException: The given object has a null identifier: com.paixie.domain.Users;

                出现这个异常,一般来说主要修改时候主键没有传递或者name属性指定错误。

            解决方案:你要把你的更新的实例的主键传过去,可以以hidden的方式传。

<s:hidden name="action中实例对象名.id" id="id"></s:hidden>


 

原文地址:https://www.cnblogs.com/oversea201405/p/3752172.html