Grails

Error by binding data from command-object to the domain-object

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.1
  • Fix Version/s: None
  • Component/s: Security
  • Labels:
    None
  • Environment:
    Windows Visa, Firefox, Eclipse 3.4,

Description

I fill my data from the form-fields in a command-object. When I assign my data from the command-object to the domain-object, then more properties will be set in the domain object as expected.

Example:

My loginform:

<g:form ...>
<input name="lastname" value="..."/>
<input name="firstname" value="..."/>
<input name="created" value="..."/>
</g:form>

class PersonController{

def save = { PersonCommand - personCmd> { ... Validation ... }

//set properties to the domain-object
person.properties = personCmd <- When I make this, and the params-map has the attribute created, then will be set firstname, lastname and created in the domain-object. Why will be set the created-Atrtribute? The Command-Object hasn't this property.
}
}

class PersonCommand{
def firstname
def lastname
}

Domain-Object
class Person{
def firstname
def lastname
def created
}

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Last Reviewed: