Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Groovy and the fly likes Cannot set readonly property - when modifing attributes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Cannot set readonly property - when modifing attributes" Watch "Cannot set readonly property - when modifing attributes" New topic
Author

Cannot set readonly property - when modifing attributes

Bill Lee
Greenhorn

Joined: Feb 02, 2007
Posts: 20
I am attempting to modify an attribute based on a criteria. When I attempt the following, I get

Exception in thread "main" groovy.lang.ReadOnlyPropertyException: Cannot set readonly property: value for class: java.lang.String

allRecords.findAll{
it.'@ZipCode'.equals('60245')
}each{
it.'@State'.value = 'IL'
}

Does anyone know how to surpass this exception? Thank.s
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot set readonly property - when modifing attributes
 
Similar Threads
set & get methods
JSP read only fields !
How to access the Struts HTML elements in JS
java.sql.SQLException
Toggling between writable and readonly for a text box