TO THE NEW Blog PAGES

Grails

Creating GIT Alias

Since Git is awesome. It also provides functionality of making aliases. Example [shell]git config –global alias.co checkout [/shell] Here we created co as an alias for checkout (All the aliases that are created goes into .gitconfig file under home folder). Now to checkout a branch named testBranch, We can also write [shell]git co testBranch Switched […]

Hitesh Bhatia
Hitesh Bhatia
Read

Grails

GIT Maintenance

Since we use git numerous times a day over and over, hence needs maintenance. There are few commands that will help you to keep our git healthy. If you feel that you git has somewhat slowed down, these would do the trick for you. Since ours is a pretty big project . I run it […]

Hitesh Bhatia
Hitesh Bhatia
Read

Grails

Grails Custom Data Binding in 3 Simple Steps

The other day, Farid came with an interesting problem of binding a Time String to java.sql.Time. We straight away found the answer in using a CustomTimeEditor and registering it using a CustomPropertyEditorRegistrar bean. We were able to come arrive at this solution, thanks to this StackOverflow thread. This set me thinking into using a CustomProperty […]

Vivek Krishna
Vivek Krishna
Read

Grails

Writing JSON APIs : Part II – Creating JSON Named Configs to Control What You Render

In the 1st part of the series, we looked at how to secure our application with Spring Security Basic Authentication and modifying the JSON Marshaller. However, it could often be the case that the same set of fields shouldn’t be returned on every JSON response. For example, we could very well have a summary JSON […]

Vivek Krishna
Vivek Krishna
Read

Grails

Closure Caching For Increased Performance (.memoize())

Well This is something awesome and can increase the performance of the project when used wisely. using the groovy .memoize() we can ask closures to perform kind of caching. This can boost up the performance of the system.   _ Note: This feature is available in groovy 1.8+ Well Let me Explain this Using Examples […]

Kushal Likhi
Kushal Likhi
Read

Grails

Discovering grails goodness: Scoped Services

Recently, I got to learn about the scoped services in grails and I found it worth sharing. For instance: A Service marked as ‘session’ scoped would be instantiated once for a session and remains there throughout the lifetime of the session. This can be used to store user specific data in this service bean class. […]

Mohd Farid
Mohd Farid
Read

Grails

Executing linux shell command using ProcessBuilder

We often need to execute linux shell command from our groovy code. What I had to do in my project was to resize the image saved on file system. I was doing something like : [java]String command = "convert -adaptive-resize ${width}x${height}! ${sourceFilePath} ${destinationFilePath}" Process process=command.execute() process.waitFor() [/java] The above code makes a new image file […]

Divya Setia
Divya Setia
Read

Grails

Dbconsole in Grails.

So, Grails 2.0 was released a few days back and I upgraded my application to it as soon as I came to know of its final release and it rocks.!! Among the many things which are making a lot of noise on grails 2.0, there seems to be a lack of noise over the GUI […]

Sachin
Sachin
Read

Grails

Way to check if user has “Liked” the Facebook Fan Page or Not

Hi, In my recent grails project, i was working on creating Apps for Facebook Fan Page and needed to show data to the user in such a way so that if he/she has “Liked” the page, then the content would be different from the case when the user has not liked it. In simple words, […]

Vishal Sahu
Vishal Sahu
Read

DevOpsTechnology

Increasing the connection timeout between browser and the tomcat server

There is a case stuck recently in my Grails development project where I need to increase the connection timeout between the browser and the server, because of the reason before the response get completed server leave the connection which resulted in no response. My colleague Himanshu told me to change the setting in server.xml, which help […]

Tarun Pareek
Tarun Pareek
Read

Grails

Detecting mobile browsers in Javascript

In my recent grails project, I was working on mobile version of the application and needed to redirect users to the mobile version of our application, if they are accessing the application from any mobile device. I looked at various techniques/codes to detect the mobile device and redirect users to the specific URL. I encountered […]

Vishal Sahu
Vishal Sahu
Read

Grails

Install Apps on Facebook Fan page using API

Hi, In my current grails project, we are using Facebooks Apps for our application so that any user who wish to use that app, can attach it with his/her Facebook Fan Page manually by visiting the App Profile Page and then adding it to the Fan Page. Then the attached facebook app can fetch data […]

Vishal Sahu
Vishal Sahu
Read