In one of our projects, we had to create PDF documents from HTML. The iText renderer was an excellent solution to do that. However, the tricky part was that the cover page had to be of portrait orientation and the rest of the document, of landscape orientation. After doing a fair share of searching on […]
Hi All, Here is how you can implement a new transaction in an already executing transaction in Grails which uses nothing but Spring framework’s Transaction mechanism as an underlying implementation. Spring provides @Transactional annotations to provide declarative transactions. We can use the same in our Grails project to achieve the transactional behavior. Here is the […]
Hi Friends, I was going through grails docs, encountered a method called load(), found it really useful thought would share with you. What load() does is, it creates a proxy object and doesn’t retrieve the record from the database until property other than id is accessed. Let us consider a scenario, where we have id […]
Auto complete .com Address Ctrl+Enter Auto complete .net Address Shift+Enter Auto complete .org Address Ctrl+Shift+Enter Back Alt+Left Bookmark All Tabs Ctrl+Shift+D Bookmark This Page Ctrl+D Bookmarks Ctrl+B Copy Ctrl+C Cut Ctrl+X Clear Recent History Ctrl+Shift+Del Downloads Ctrl+Shift +Y Error Console Ctrl+Shift+J Forward Alt+Right Close Tab Ctrl+W Close Window Ctrl+W New Tab Ctrl+T New Window Ctrl+N […]
Recently in a Grails project that I am currently working on, the client wanted to have few functionalities of our web application on iPhone as well. We are using Enums heavily in our project and the iPhone development cannot recognize from looking at the tables that few fields are Enums so those need to be […]
Hi All, Here are the few basic steps that you need to follow in order to achieve the in-memory session replication between two or more Tomcat 6 instances. This blog refers the Apache Tomcat documentation as found here: http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html. The Tomcat documentation provides more detailed explanation of the Clustering concepts as well as the definition […]
In one of our recent projects, we needed to save the HTTP session in the database. This blog refers the Apache documentation as found here: http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html These are the following steps that need to be followed: Step 1: Create a database named tomcat (as shown in our example in Step 3 below) or any other […]
On most of my grails projects, I am used to let grails handle database schema creation for me. However, there is a project where the database is shared between multiple applications. In that project, we have to check-in our table creation/modification script as a SQL file, which is later executed by a DBA. I use […]
Rcconf is a tool that we recently discovered. This tool allows you to manage your start-up applications easily. We found this tool when me and my colleague Aman were trying to identify the processes that we never use but they do eat up a lot of our system resources. We found this link very useful: […]
While using searchable plugin for the first time, I wasn’t aware that lucene implements only lexicographic comparisons for searching on indexed values (even on numeric fields). Before I learned this, I kept on wondering why a Person of age 6 always appeared in search results when I look for People more than 20 years of […]
This is more towards the best practices and my experiences for developing an application at a faster rate. In my current project, we are using many different APIs (for external services). And usually it takes time to explore, implement and then stabilize the application. Also, it’s not over once you stabilize your APIs based code. […]
I have been using the following code to get paginated result and the total number of results returned irrespective of the pagination params. def result=SampleDomain.createCriteria().list(){ // multiple restrictions maxResults(params.max) firstResult(params.offset) } // Return type is ArrayList Integer totalResult=SampleDomain.createCriteria().count(){ // multiple restrictions // maxResults(params.max) // firstResult(params.offset) } Clearly duplicating the same closure except for the pagination […]