Questions tagged [command-objects]

Command Objects are a feature of the Grails web framework, refering to special classes that declare constraints used to validate its instances.

Resources

Official docs

Related tags:

90 questions
2
votes
2 answers

Could not serialize flow execution

Exception: Error 500: Could not serialize flow execution; make sure all objects stored in flow or flash scope are serializable Servlet: grails URI: /payment.com/grails/payment/makePayment.dispatch Exception Message:…
user597987
2
votes
3 answers

Usage of command objects in Grails for updates

I read that services are used for updates across multiple domain classes. However, I have command classes, and I would like to know whether putting the logic that makes transactional updates into a command class has a significant downside (or…
user606153
  • 47
  • 1
  • 6
2
votes
1 answer

Spring @ModelAttribute for only one handler method

Is it possible to let @ModelAttribute method be invoked only for a specific handler method and supply the command object for only one handler method invocation ? Not for each handler method within a particular controller ? I'm using spring…
lisak
  • 21,611
  • 40
  • 152
  • 243
2
votes
1 answer

Grails - dedicated source folder for Command Objects?

From what I have read most people either place command objects inside the controller (which I am not a fan of) or place them somewhere inside the src/groovy folder. I, however, like how Grails has specific folders for controllers, domains, services,…
kjackson
  • 65
  • 7
2
votes
2 answers

Command Object and hasmany

I'm trying to use the commandObject to validade my data when I submit my form. Can I validate a hasMany relation in commandObject. My cenario is something like this. Tow simple classes whith hasMany relationship: class Book{ String…
leomeurer
  • 742
  • 1
  • 8
  • 24
2
votes
4 answers

Grails - How to clear previous validation errors in command object?

How to clear previous validation error messages coming from Command object when a user clicks on the browser back button? Here is the sample code: def create = { UserInfoCommand cmd -> if (cmd.validate()) { println("Command obect…
TP_JAVA
  • 1,002
  • 5
  • 23
  • 49
2
votes
1 answer

Grails commandObject beforeValidate

It would appear that Command Objects in grails lack the beforeValidate method that domain classes have? I'm not quite sure why this is or if I'm missing something? I've several command classes where i'd like to do some whitespace trimming etc…
crebbo
  • 305
  • 3
  • 8
1
vote
2 answers

Are there advanced uses for Grails command objects?

Are there advanced uses for Grails command objects? Majority of the pages out there have a command object with all of its fields as Strings, Floats, Integers. Is there a way to make it use domain classes similar to how a Domain class may have have a…
Christian
  • 1,241
  • 2
  • 8
  • 11
1
vote
2 answers

How to bind data to a command object that has a nested property? (non domain object)

I am trying to bind some data to an object that is part of a command object. The object stays null when trying to use it. Probably i am not giving the correct data in the gsp but i have no clue what am i doing wrong! I would expect that when i…
Marco
  • 15,101
  • 33
  • 107
  • 174
1
vote
1 answer

Grails Duplicate Error Messages

I'm new to grails and I have a problem: I have this snippet of GSP:


Pablo Fernandez
  • 103,170
  • 56
  • 192
  • 232
1
vote
1 answer

Grails command objects and input name values

I have a form where I have to have the input elements ordered specifically. So my form looks something like this: ... I have a…
intargc
  • 3,051
  • 5
  • 36
  • 52
1
vote
3 answers

Grails 3: Binding multiple command objects via POST

I have a controller with a method that I want to bind multiple command objects too. When I call the method via GET, it works great and both objects get bound. The issue is if I call the method via POST, only the first command object gets bound and…
1
vote
1 answer

Can't bind list to command object without indexing

I'm trying to make the default data biding to work with a command object that has a domain object list. This are domain classes and command objects from an example project I created not my final domains. package testbinding import…
ANY
  • 21
  • 4
1
vote
1 answer

Does Grails command object support multiple MultipartFile?

I want to store multiple image in Grails application. So, command object of grail support multiple MultipartFile files.
Robin
  • 31
  • 4
1
vote
0 answers

transactionStatus causing groovy.lang.MissingPropertyException in controller action with command object parameter

I have a transactional controller with two actions inside it, edit and update. The update action has a command object parameter. If I call transactionStatus.setRollbackOnly() in the update action, I get MissingPropertyException for…
vphilipov
  • 11
  • 3