概述
How to solve this issue:
I want to Change key of my bean map with celledit feature from primefaces.
For editing the value of map it works well.
For changing the key i get following error:
javax.el.PropertyNotWritableException: The class 'java.util.HashMap$Node' does not have a writable property 'key'.
editable="true" editMode="cell" >
update=":form:msgs" />
解决方案
The reason that you get an error is that the keys in an entrySet are immutable. The entrySet() method returns a Set. If you look at the javadocs for Map.Entry you will see:
a V getValue() method,
a void setValue(V) method,
a K getKey() method, but
no void setKey(K) method
Basically, the key property is read-only per the JavaBeans convention. That's actually a good thing, because if you could modify a key in an Set you would have the difficult problem of what to do if the new key was the same as the key of another entry in the original map.
最后
以上就是俊逸皮皮虾为你收集整理的java node 获取属性,类'java.util.HashMap $ Node'没有可写的属性'key'的全部内容,希望文章能够帮你解决java node 获取属性,类'java.util.HashMap $ Node'没有可写的属性'key'所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复