hibernate3

<property name="hibernate.hbm2ddl.auto" value="update" />

entity class not found: User
user.hbm.xml配置出错
需要完整的路径,如下
<hibernate-mapping>
    <class name="com.hibernate.model.User" table="user" catalog="zhangwei" >


Positional parameter does not exist: 1 in query: from User u where u.name=?

query.setString(1, name);
如何改呢?如下:
query.setString(0, name);
设置参数从0开始

mapping.findForward("success");前面没有加return就继续下一行代码


validator框架
显示error:<html:errors property="password" />
validation.xml:
<field property="password"
depends="required">
<arg0 key="login.pass"/></field>
这是不能为空。


name can not be less than null characters.
{1}值没有?为null?
因为name写错了。<arg1 name="minlength"
改后又成这样的啦:如下:
name can not be less than ${var:minlength} characters.??


<field property="name"
depends="minlength">
<arg0 key="login.name"/>
<arg1 name="minlength" key="${var:minlength}" resource="false" />
<var>
<var-name>minlength</var-name>
<var-value>6</var-value>
</var>
</field>

<field property="name"
depends="maxlength">
<arg0 key="login.name"/>
<arg1 name="maxlength" key="${var:maxlength}" resource="false" />
<var>
<var-name>maxlength</var-name>
<var-value>18</var-value>
</var>
</field>


<field property="name"
depends="mask">
<arg0 key="login.name"/>
<var>
<var-name>mask</var-name>
<var-value>^[a-z]*$</var-value>
</var></field>


org.springframework.dao.DataIntegrityViolationException: not-null property references a null or transient value: com.hibernate.model.User.password; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value: com.hibernate.model.User.password??



你可能感兴趣的:(DAO,html,xml,Hibernate,框架)