TO THE NEW Blog PAGES

Grails

Groovy: Sort list of objects on the basis of more than one field

Usually, when we deal with databases, we don’t face such kind of situation because we query database to get result-set in required order. But let’s say you have a List of objects that you want to sort on the basis of two fields. Let’s discuss it with an example. I have a list of Tasks […]

Salil
Salil
Read

Technology

Git – Grep

Still in my early days of using Git. Recently just to make sure that I have merged two branches  and have pushed changes to QA server successfully,I often used command “find | xargs grep” .But to deal with this kind of situations Git provides “grep” command. Just as name suggests this commands searches for regex pattern […]

Hitesh Bhatia
Hitesh Bhatia
Read

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

Technology

Getting up and Running With Cassandra

Luckily, I got some time outside my usual obligations in the project, to learn something new and I devoted the time to getting up and running with cassandra . Getting starting up with it was a bit bumpy, as the case almost always is when you start with something entirely new. Lets get Started.. 1) […]

Sachin
Sachin
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

Technology

Audio html5

Audio tag is a html 5 element. You can play audio file on web page without any third party plug-in. This will work only on html5 compliant browser. Flash player is widely used to play audio and video files on web. There are some third party plug-ins likes Flash Player, QuickTime, Real Player etc available […]

Umar
Umar
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
Services