Am 22.06.2015 um 21:56 schrieb Ercan Canlıer: > Hello, > As i mentioned at the mail subject, i am having problem with not mutable > map inside BasicDynaBean. > As far as i know, it is the default behaviour of this map. > What i would like to do is, simply retrieve the resultset from db which > will create a list including DynaBeans. > For viewing the database table, everything works fine, the problem occurs > when i try to edit it and i get the following exception: > > Caused by: javax.el.PropertyNotWritableException > at javax.el.MapELResolver.setValue(MapELResolver.java:267) > at > com.sun.faces.el.DemuxCompositeELResolver._setValue(DemuxCompositeELResolver.java:255) > at > com.sun.faces.el.DemuxCompositeELResolver.setValue(DemuxCompositeELResolver.java:281) > at com.sun.el.parser.AstValue.setValue(AstValue.java:201) > at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:291) > at > com.sun.faces.facelets.el.TagValueExpression.setValue(TagValueExpression.java:131) > ... 50 more
This stack trace does not contain a reference to Commons BeanUtils. Also, the exception thrown is from the Java expression language (EL), not from BeanUtils. It seems to me that there is already a problem in your path expression before the DynaBean is actually hit. I don't know EL well enough, but could it be the case that it simply cannot handle dyna beans? Oliver > > I assume, this is because of the map inside dyna bean is not mutable. > I think one option is to change the default behaviour of the map by editing > the source code of BeanUtils library. > On the other hand, i think the implementors of this library must have > thought this functionality somehow... > Below is the code snippet that i use for retrieving the result set as > DynaBeans. > > > String query = "SELECT * FROM test.a"; > > Statement stmt = (Statement) con.createStatement(); > ResultSet rs = stmt.executeQuery(query); > RowSetDynaClass rsdc = new RowSetDynaClass(rs); > > rs.close(); > stmt.close(); > dynaObjectList= rsdc.getRows(); > > I tried to use LazyDynaMap as well, editing the table worked fine but the > Map didnt allow me to put multiple data since the key is not unique for > other datasets. > Because the key is the property name. > > I would be really appreciated if you suggest me hints. > Thanks in advance. > I am really looking forward to see the answers if possible. > Best regards. > Ercan CANLIER > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org