There is no getter for property named 'user' in 'class com.learn.pojo.User'
时间: 2023-10-13 09:22:20 浏览: 126
As an AI language model, I cannot tell the exact reason for this error without seeing the code. However, based on the error message, it seems that you are trying to access a property named "user" in an instance of the class "com.learn.pojo.User", but there is no getter method defined for this property in the class.
To solve this error, you should define a getter method for the "user" property in the "com.learn.pojo.User" class. The getter method should have the same name as the property and should return the value of the property. Here is an example of how to define a getter method for the "user" property:
```java
public class User {
private String user;
public String getUser() {
return this.user;
}
public void setUser(String user) {
this.user = user;
}
}
```
In this example, the "getUser" method is the getter method for the "user" property. It returns the value of the "user" property when it is called. You can now access the "user" property using the "getUser" method without getting the "no getter for property named 'user'" error.
阅读全文