我的开发手记

1.项目中映射类最好都实现序列化接口:Serializabale(java.io.Serializable);

2.

<bean id="standardItemTypeAction" class="com.sinosoft.module.civilizationconstruction.action.CcStandardItemTypeAction" scope="prototype">
    <property name="standardItemTypeService" ref="standardItemTypeService"/> //name属性和ref属性的值最好保持一致  否则bean会注入失败
</bean>
<bean id="standardItemTypeService" class="com.sinosoft.module.civilizationconstruction.service.CcStandardItemTypeServiceImpl">
    <property name="standardItemTypeDao" ref="standardItemTypeDao"/>
</bean>
<bean id="standardItemTypeDao" class="com.sinosoft.module.civilizationconstruction.dao.CcStandardItemTypeDaoImpl">
    <property name="sqlSessionFactory" ref="sqlSessionFactory"/>
    <property name="sqlMapNamespace" value="com.sinosoft.module.civilizationconstruction.model.CcStandardItemType"/>
</bean>

 3.将js变量的值传给隐藏域时用 document.getElementById("id") = id,(id为变量的值),不能用$("#id").val()获取。

 4.循环插入记录每一次都在循环内创建一个新的对象

 5.There is no getter for property named 'ID' in 'class com.sinosoft.module.civilizationconstruction.model.CcRandomDataUnit'

出现此异常的原因是Mapper中传入的参数类型没有名为“id”的属性。

 6.Mapped Statements collection does not contain value for XXX  是因为没有将实体类的Mapper文件引入到sqlMapConfig.xml里

原文地址:https://www.cnblogs.com/lxcmyf/p/5713848.html