TO THE NEW Blog PAGES

Technology

How to customize input type file upload ?

We can transform the look and feel of almost every element of HTML but it is quite difficult to apply style and change the look of input type file. This tag is use for choosing a file from local machine and upload it on web. In one of my project i have tried to change […]

Kapil Chotwani
Kapil Chotwani
Read

Technology

@Canonical annotation

@Canonical: It’s very useful annotation. It provides the combination of features of @ToString (default implementation of toString() method based upon the fields in the class), @EqualsAndHashCode(default implementation of equals() and hashCode() method of the class based upon the fields in the class) and @TupleConstructor (provides the classical constructor with default properties). [groovy] import groovy.transform.Canonical @Canonical […]

Mohit Garg
Mohit Garg
Read

Grails

Cool way to get/set processed HTML Markup in filters

Hi,   There was a case where i had to encrypt the HTML output of the GSP before displaying it to user. There are a lot of ways to do it, but i wanted to make is as simple as possible. Hence here is the pattern i used:   Note: This is just an example, […]

Kushal Likhi
Kushal Likhi
Read

Grails

Groovy: Overriding “Plus” operator in a class with interesting example

Have you ever wondered how to overload “plus” operator in Groovy ? It is as easy as adding toppings to your favourite pizza. Let me explain. Let us taka a class for Pizza:   [java] @ToString class Pizza { String name List<Topping> toppings double price } [/java] And another for the Topping: [java] @ToString class […]

Imran Mir
Imran Mir
Read

Grails

Getting property class from property name

Recently in one of my project i had a requirement of identifying the class of a property of an object with object class and property name and then determining whether it’s an Enum class or not. I found an easy solution for this using Reflection API. Using Java Reflection you can inspect the fields (member […]

Sachin Verma
Sachin Verma
Read

Grails

FindResults and FindResult Methods of Groovy

In almost all the applications that we work on, we have to transform elements of a collection in one way or the other. We can do it in different ways. Let there be a domain “Employee” with following attributes: [java] class Employee{ String firstName String lastName Double salary } [/java] And we have 5 Employees: […]

Vivek Sachdeva
Vivek Sachdeva
Read

Grails

Fire Plugin OnChange/onConfigChange Event at Run Time Manually

Hi,   Suppose you have implemented some logic in your application which updates the Config at runtime.   Now after you have updated the config, you should notify the plugins about configChanges such that they reload their configurations. This can be done by firing the onConfigChange Event of the plugins.   Similarly you can also […]

Kushal Likhi
Kushal Likhi
Read

Technology

HTML5: Making editable elements

HTML 5 provides some very good features, one of it is EDITABLE Elements.   It is very helpful in creating dynamic HTML5 applications, and very simple to use.   so lets keep the blog short and sweet and see the code which is as follows [html] &lt;h1&gt;Todo List&lt;/h1&gt; &lt;ol contenteditable=&quot;true&quot;&gt; &lt;li&gt;Enter contents&lt;/li&gt; &lt;/ol&gt; [/html] you […]

Kapil Chotwani
Kapil Chotwani
Read

Technology

Getting started with knockout.js

Recently, I learnt something very new e.g. Knockout.js. It is quite a advanced form of javascript. It just simplifies the structure of the javascipt in your application. It basically follows MVVM pattern(Model View View Model). It is quite fast and easy to use as comparison to jquery. Some of it’s key features are :- 1. […]

Robin
Robin
Read

AngularJSFront End Development

AngularJS : Multiple Views, Layout Template and Routing

Need For Multiple Views In all previous examples which I used on AngularJS, there was only a single view, i.e. the view displaying the list of youtube videos. Now let’s say we wan’t to display a detail page when a video is clicked. On the detail page, we will display more details about the video […]

raj
raj
Read

Grails

Reading comments of LinkedIn wall post

Hi, In one of my grails project, i needed to show the comments on any wall post of linkedin through API. I used the Java wrapper to connect any linkedIn account with the grails application which can be seen here. But somehow this library was not working when we need to fetch comments from any […]

Vishal Sahu
Vishal Sahu
Read

Grails

Instance based login in spring security core

Spring security loads the roles of user from user role table based on all roles assigned to user and that role is application specific. But In my project i require to assign roles to user based on instance . So when the instance is changed roles should be changed .In grails we can overide the […]

Shaurav
Shaurav
Read