问题描述
- 新手学hibernate简单登录遇到未知错误
-
package com.gloomy.rigister.model;import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;@Entity
public class user {private int id; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public int getId() { return id; } public void setId(int id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } private String username; private String password;
}
错误信息
严重: Developer Notification (set struts.devMode to false to disable this message):
Unexpected Exception caught setting 'passrword' on 'class com.gloomy.rigister.action.userAction: Error setting expression 'passrword' with value ['25', ]
九月 27, 2015 10:18:34 上午 com.opensymphony.xwork2.interceptor.ParametersInterceptor error
严重: Developer Notification (set struts.devMode to false to disable this message):
Unexpected Exception caught setting 'password1' on 'class com.gloomy.rigister.action.userAction: Error setting expression 'password1' with value ['25', ]
九月 27, 2015 10:18:34 上午 com.opensymphony.xwork2.interceptor.ParametersInterceptor error
严重: Developer Notification (set struts.devMode to false to disable this message):
Unexpected Exception caught setting 'username' on 'class com.gloomy.rigister.action.userAction: Error setting expression 'username' with value ['he', ]
解决方案
我自己粗心把index.jsp中form表单中的password写成passrword了
解决方案三:
hibernate学遇到的错误
解决方案四:
@Id和另外一个@不应该是在id变量前面的吗?