DevOpsGrails

Server-to-server POST request

Server to server POST request can be made using Apache Commons HttpClient library. You need to include http-client jar file in project/lib folder and execute following lines of code: HttpClient client = new HttpClient() String url = “http://localhost:8080/test/person/delete/1” PostMethod method = new PostMethod(url) int returnCode = client.executeMethod(method) //Response Code: 200, 302, 304 etc. def response […]

Aman Aggarwal
Aman Aggarwal
Read

Grails

Grails criteria query : ‘createAlias’ made it easy

Hello friends, In my grails project, I was finding it difficult to write a query using criteria which can be read as ‘list all customers whose current account balance is more than minimum account balance of that customer’. The simplified form of the domain is given below : [java] class Customer { String name Account […]

Amit Jain
Amit Jain
Read

Grails

Grails taglib and JavaScript file

We use internationalization feature in grails using message tag in GSP pages. However arbitrary Groovy/Grails (e.g. tags) code can not be used in JavaScript as they are not executed on server side. To overcome this I used the following way : Declare a JSON object in js file or any where else so that this […]

Bhagwat Kumar
Bhagwat Kumar
Read

GrailsTechnology

Why use Grails?

Last week, I was talking to a prospective client, who instead of asking me, why we should go with TO THE NEW, asked me, why should we go with Grails? Considering the fact that I have been working with Grails for over 3 years and we are a Groovy/Grails focussed shop, it should have been […]

Deepak Mittal
Deepak Mittal
Read

Grails

How to use Thread-Pooling using Groovy

Grails Development is challenging and most Groovy and Grails projects require in-depth understanding of thread-pooling. As a Groovy developer, I really like the thread-pooling API (in java.util.concurrent package), especially when you are hitting x number of API dealing with outside network to fetch information for a single request. Example: A website dealing with some kind […]

Salil
Salil
Read

Grails

Curried Closures in groovy

There’s a feature that adds spice to Groovy—it’s called Curried Closures. The term curry is taken from Haskell Curry, the mathematician who developed the concept of partial functions. Currying refers to taking multiple arguments into a function that takes many arguments, resulting in a new function that takes the remaining arguments and returns a result. […]

Grails

JQuery script to put focus on first field of any page

Hi, In my recent grails project, i needed to put focus on the first field of any page whenever the page loads. The requirement is such that if the page contains errors then the focus should be on the first input field which has errors. I searched a lot and with the help of my […]

Vishal Sahu
Vishal Sahu
Read

Grails

PageChangeListener for debugging in functional testing using Geb

While using Geb for fuctional testing i require some deugging support so i use PageChangeListener and i found it very useful to find flow of pages while testing my application fuctionally.What it does is it will show the page flow from one page to another.For that we need to just register the PageChangeListener with browser […]

Anuj Aneja
Anuj Aneja
Read

Grails

Mysql Dump multipurpose script.

Taking MYSQL dump is usual requirement in my project . And Since some of the tables in project are huge so often I have to take dumps of selected tables and often have to ignore some tables. since we had to do it frequently in our project so I created a script  which does following […]

Hitesh Bhatia
Hitesh Bhatia
Read
Services