TO THE NEW Blog PAGES

Grails

Finding User’s Session Locale in GSP

There are situations where you might want to know the Locale of the user as set in the session in your GSP so that you can show text in a particular language/manner. Here the Spring framework’s SessionLocaleResolver can come to the rescue. In one of our recent Grails projects, we did the following in one […]

Technology

Generating stubs for SOAP calls using IntelliJ IDEA

Since working with SOAP calls in XML is very tiresome, we have libraries like axis and wsdl2java to generate stubs to make web-service client calls. I generated the stubs using IntelliJ IDEA to make SOAP calls in grails using the steps below. 1. Adding Framework Support If the IntelliJ project does not already have the […]

Sachin
Sachin
Read

Grails

Grails Hibernate Filter Plugin a Life Saver

The project I am currently working on is also accessible from the iPhone. In the last few months so many changes have been done on the web application (developed in groovy/grails). Now the client wants the same thing on iPhone as well. He has a separate development team for iPhone application. The iPhone application developer […]

Grails

Integrating Java Application with Twitter

These are few basic steps which will help you to integrate your java application with twitter using twitter4j. Twitter4J is a Java library for the Twitter API. With Twitter4J, you can easily integrate your Java application with the Twitter. Steps : 1) Register your application at http://twitter.com/apps 2) Twitter will return Consumer Key and Consumer […]

Technology

Merge two PDF files

In my current project the user has the option to add pdf file into the system. Recently we got the requirement to add a cover page to each pdf document that user downloads. We were already using the iText API for generating pdf so the task to do that was easy. After going through the […]

Grails

Suppress Tracking of various scripts on test and development environment

In my recent project, every time the page loads, it loads with lots of scripts making calls to and getting content from googleapis, fb, clixpy, cdn etc. to provide the functionality, due to which the page loads very slowly and this led to the wastage of time to test a certain functionality. To overcome this […]

Grails

Deploying Grails application on Websphere Application Server V6

Hi, In one of my projects, I needed to deploy the grails application on IBM Websphere Application Server Version 6. So the steps I followed to deploy the application are as follows:- Step-1: Install the IBM Websphere Application Server 6.x 1. Install the Websphere Application Server using its installer. (If it is needed to be […]

Technology

Rounded corner and CSS3 Gradient with border

First download these files: http://code.jquery.com/jquery-1.4.2.min.js You can round corner DIV, LI tags and others You add a class where you want round corner Add this CSS: .cornerBox ul li.corner{zoom:1;border:0;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=’#1f858f’,EndColorstr=’#329ba6′);background:-webkit-gradient(linear, left top, left bottom, from(#1f858f), to(#329ba6));background:-moz-linear-gradient(top, #1f858f, #329ba6);background:#1f858f;} .cornerBox ul div.outer {background:#fff;padding:0;margin-top:15px;} Add this jQuery code: $(function(){ $(‘.corner’).wrap(‘ ‘); $(‘.corner’).corner(“round 3px”).parent().css(‘padding’, ‘1px’).corner(“round 3px”) }); Hope this […]

Umar
Umar
Read

Technology

Drop unique constraint in MySQL

Recently in my Grails project I mentioned a domain field as unique in constraints. So the table automatically created also had the same constraint, but as the requirement changed the field was not supposed to be unique. Now we need to remove that constraint from the database table as well. The trick in MySQL is […]

Grails

Grails: Change number of records displayed with Remote-Pagination

Hi Friends, I have released version 0.2.3 of remote-pagination plugin, which includes an option to enable user to change page sizes out of the given options. As given in the documentation, lets have a look at the example below : //Example Domain: class Book { String title String author } //Example controller: class BookController { […]

Grails

Clearing Hibernate Query Cache in Grails

In one of the projects, we had used Query Caching to improve the performance. However, it also meant that the updates/inserts into a table did not get reflected immediately, i.e. something like: DomainClass.findByPropertyName(“propertyName”, [cache: true]) returned the same list as it was, before the insertion/updation took place. We found that this could be resolved by […]

Grails

Open Pdf in Google Docs using Time Based Cache in Grails

Recently, we had a requirement where secure URLs were to be made accessible to Google. Our implementation was to send a url with token valid for 10 seconds. The token expired automatically after 10 seconds. We used time based cache for this as described here: T set max time to 10 seconds , I set […]