Questions tagged [grails-controller]

This tag is about the controllers in Grails Open Source Framework technology.

Grails is an Open Source, full stack, web application framework for the JVM. It takes advantage of the Groovy programming language and convention over configuration to provide a productive and stream-lined development experience.

This tag is about the controllers in Grails technology.

467 questions
6
votes
1 answer

how to force https

I have a grails project. Right now, the user can access it either with HTTP or HTTPS. I would like to require that they can only access it through HTTPS. any ideas? I do have spring security core installed, if that can be of help thanks jason
jason
  • 3,821
  • 10
  • 63
  • 120
6
votes
1 answer

Grails, how to find by a record by its foreign key

I have two domains that are a part of a one-to-many relations ship. I was wondering how i can query the child for the parents FK? bellow is the psuedo-code for parent/child Parent: class AlumProfile { String firstName String lastName …
jason
  • 3,821
  • 10
  • 63
  • 120
6
votes
5 answers

Reading out all actions in a Grails-Controller

I need to read out all available actions from any controller in my web-app. The reason for this is an authorization system where I need to give users a list of allowed actions. E.g.: User xyz has the authorization for executing the actions show,…
kenan
  • 61
  • 1
  • 2
6
votes
1 answer

Mapping hasMany relation and saving the related data

I have two domain classes Question and Tag. Question has 'hasMany relation' with Tag. I am trying to save a question with some tags, but the error message is "Failed to convert property value of type java.lang.String to required type com.org.Tag…
6
votes
2 answers

How do you test service or controller methods in grails 2.3

I'm just starting out with grails 2.3 and I have problems getting the unit tests to run. What I've done so far is I've run grails create-app new-app grails create-service NewService grails test-app This produces | Running 1 unit test... |…
Spade
  • 310
  • 3
  • 21
5
votes
1 answer

Grails update instead of delete

Is there an easy way in Grails to not allow deleting for any Domain Class? And rather have a delete flag in each domain which gets updated whenever something is deleted. Also, in effect all the list/show methods should not show objects where delete…
Sap
  • 5,197
  • 8
  • 59
  • 101
5
votes
2 answers

Grails 2.0.0.RC3: Could not reload changes to controller, java.lang.NoSuchFieldException: __timeStamp__239_neverHappen1323622798918

This error has been popping up lately since I started evaluating Grails 2.0.0.RC3. I make simple changes to a controller, then save. From pictureList.count() which somehow worked in 1.3.7 but not in 2.0.0RC3 def tagged = { def pictureList…
gotomanners
  • 7,808
  • 1
  • 24
  • 39
5
votes
4 answers

Grails redirect in controller switching from https to http. Why?

I have a Grails app with some pages only accessible over https and some over http. This is easily handled using a before filter. However when on an https page as soon as a controller does a redirect the user ends up back on http and is directed to…
David Tinker
  • 9,383
  • 9
  • 66
  • 98
5
votes
2 answers

Grails Redirect Post-Logout Using spring-security-core-3.0.6+

In spring security version 3.0.6, which fixed a CRLF logout exploit (https://jira.springsource.org/browse/SEC-1790) they disabled the use of the 'spring-security-redirect' parameter. Default support for the redirect parameter in logout URLs has…
tmarthal
  • 1,498
  • 19
  • 28
5
votes
1 answer

How can I use path variables in grails controller?

I have been trying to use a path variable in grails controller but I am not able to achieve it. The intention behind is to validate the parameter submitted to the url which I need to make mandatory. I could not achieve it through RequestParam so I…
Vishal
  • 666
  • 1
  • 8
  • 30
5
votes
1 answer

Can Grails compose responses?

The folks over at LinkedIn have been using Play in an interesting way to handle pages that need to be composed of many different components: http://engineering.linkedin.com/play/composable-and-streamable-play-apps The critical component of how they…
cdeszaq
  • 30,869
  • 25
  • 117
  • 173
5
votes
2 answers

How to navigate Grails core source code to better understand framework?

Typically in Spring Source Tool Suite IDE or Eclipse Maven project, if I want to see what a framework/library method is doing behind the scenes, I can ctrl + click on the method name and it will take me to the source code. I understand that a lot of…
bholl
  • 181
  • 1
  • 8
5
votes
3 answers

Grails 2.3 - run-app not working

I am getting error while running my Grails app. My application working in Grails 2.1.4. I am using Groovy 2.1.* Java 1.7 Tomcat 7.0.37 I upgraded my application from Grails 2.1.4 to 2.3.0.M1. After I am getting some error like this: | Loading…
Sun
  • 3,444
  • 7
  • 53
  • 83
5
votes
1 answer

Deserialize a JSON object with support for embedded associations

Is there an easy way to deserialize a JSON string to a domain class with support of embedded association; belongsTo and hasMany { name: "Customer", contact: { name: "Contact" } } class Customer { name Contact contact } class…
ken
  • 3,745
  • 6
  • 34
  • 49
5
votes
2 answers

Grails 2.2.0 Support in Eclipse

I am trying to create a grails 2.2.0 project using eclipse-jee-juno. It gives me an error Groovy compiler level expected by the project does not match workspace compiler level. Project compiler level is: 1.8.X Workspace compiler level is 1.7.X Go…
user1811107
  • 729
  • 3
  • 18
  • 39
1
2
3
31 32