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
0
votes
2 answers

Grails 2.3.1 Command Object Data Binding at Controller Parameters

I recently upgrade from grails 2.2 to 2.3.1. My controller used to bind data to an command object at controller parameters. After I upgraded to 2.3.1, the binding seems not working and have '[Fatal Error] :-1:-1: Premature end of file.' output to…
xat
  • 85
  • 2
  • 5
0
votes
1 answer

Grails command object temporary field validation

I have a user registration form where the fields are validated using command object. One of the fields is a checkbox, which must checked before proceeding the registration, and it isn't saved to the domain object. This checkbox has a corresponding…
rpozarickij
  • 1,477
  • 3
  • 14
  • 27
0
votes
2 answers

How to enforce Grails command objects have been validated?

We use the following general pattern with Grails controllers and command objects SomeController { def someAction() { SomeCommandObject co = SomeCommandObject.valueOf(params) if(!co.validate()) { // return bad…
P. Deters
  • 815
  • 2
  • 9
  • 18
0
votes
1 answer

Grails - combine errors in command object and subobjects

I checked out Grails: How to combine domain objects' errors with command objects' errors?, but for some reason the solutions aren't working for me. It's possible they're only for Grails 1.3.7 and not Grails 2.2.1. I have a command object…
Anonymous1
  • 3,877
  • 3
  • 28
  • 42
0
votes
0 answers

Binding Request Params to Command Object Properties with Different Names in Grails

I have a g:form in my GSP with field names like "email-address", "passwd", and "passwd-confirm". I also have a Command object with properties like "email", "password", and "passwordConfirm". In my controller action I would like Grails to bind the…
erturne
  • 1,799
  • 1
  • 15
  • 29
0
votes
2 answers

Grails Command Object Not Work on Production Environment

I am new in grails i am using commmand object for login validation. it work fine in development environment but not work in production environment def login={LoginCommand loginCommand-> if(!loginCommand.hasErrors()){ ........ } …
Piyush Chaudhari
  • 962
  • 3
  • 19
  • 41
0
votes
1 answer

Crystal Reports & Raiser's Edge: Selecting Data from 2 Joined Tables

I have a strange issue. I have data stored in 2 tables. Table 1: Contains data about an Individual IndividualID Birthdate Email Table 2: Contains the Individual names split into 3 fields each having a key. IndividualID NameType Name This means…
Steve Kiss
  • 1,108
  • 3
  • 13
  • 24
0
votes
1 answer

Grail command objects instance validation?

Let's say I have a command-object containing seven fields(String monday, String tuesday, ..) and I need to validate it just to check if at least one of them exists. Because of working with Grails 1.3.7 I tried to use instance validation with…
Adagio
  • 1
0
votes
2 answers

Can Spring use a simple String as form command object?

I wish to use Spring's powerful binding tools (errors/validation/tag library/etc.) on a form that really only has one bindable value. Rather than having an object containing a single String property ("name"), I'm trying to use a basic String as the…
Ryan H
  • 349
  • 1
  • 6
  • 20
0
votes
1 answer

In Spring, Are command object stored in session or in request

command objects are stored in session or comes along with the page request? if stored in session, it could cause issue while working on same page in multiple tabs, isn't it? or do we have control over that? Thanks senthil
senthil
  • 335
  • 1
  • 4
  • 7
0
votes
1 answer

grails 2.1.1 command object service injection for custom validator

Grails 2.1.1 I can't seem to get a command object to be injected with a service so that I can use custom validator. I've tried several things, including Grails command object data binding and what the 2.1.1 docs on custom validator suggest, I just…
jbowen7
  • 71
  • 1
  • 5
0
votes
1 answer

Spring is not mapping @pathVariables correctly to the correct variables

We're having an issue where the values that we take in via @PathVariable or via binding under moderate load are getting assigned to the wrong variables. For doing these tests we're always hitting the same URL's. Hitting the URL's slowly produce the…
0
votes
1 answer

Using a command object boolean with a input:checkbox in grails

This is probably a ridiculously easy question, but I've been struggling with it nonetheless. I have a form: . . .
aasukisuki
  • 1,186
  • 1
  • 11
  • 33
0
votes
1 answer

Spring: How do I construct this command object through a GET HTTP request?

I'm using Spring 3.1.0.RELEASE with Hibernate 4.0.1.Final. I want to invoke a search method in a controller that takes as input a search bean (the Event bean below) ... @RequestMapping(value = "/search_results.jsp") public ModelAndView…
Dave
  • 15,639
  • 133
  • 442
  • 830
-1
votes
1 answer

Grails Command Object validation for input list

Hi how do I set the command object constraint nullable, blank, and custom for these 2 list, event[] and qty[] from the below html?