在 Spring 类中找不到 setter 属性
我有一个 Spring 应用程序并部署在外部 tomcat
(version-8.0.0) 中。使用 STS
ide 进行开发。
applicationContext.xml
<bean id="Manager" class="com.data.managers.Manager" p:hostName="${hostName}"
p:userName="${username}" p:pWord="${password}">
</bean>
管理器类
public class Manager {
private String pWord;
public void setpWord(String pWord) {
this.pWord = pWord;
}
}
当我构建应用程序时,applicationContext 文件显示错误,
No setter found for property 'pWord' in class com.data.managers.Manager
这里出了什么问题。
帮助我解决这个问题,
提前致谢
I have a spring application and deploying in external tomcat
(version-8.0.0).Using STS
ide for development.
applicationContext.xml
<bean id="Manager" class="com.data.managers.Manager" p:hostName="${hostName}"
p:userName="${username}" p:pWord="${password}">
</bean>
Manager Class
public class Manager {
private String pWord;
public void setpWord(String pWord) {
this.pWord = pWord;
}
}
When i build the application,applicationContext file showing error
No setter found for property 'pWord' in class com.data.managers.Manager
what was wrong here.
Help me to solve this issue
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
pWord
的 Getter 和 Setter 应该是getPWord()
和setPWord()
。set
和get
后面的第一个字母应该大写。最好将属性更改为
password
并将 getter setter 更改为getPassword
和setPassword
Getter and Setter for
pWord
should begetPWord()
andsetPWord()
. The first letter afterset
andget
should be uppercase.Better change the property to
password
and getter setter togetPassword
andsetPassword