The entity name must immediately follow the '&' in the entity reference. Blogspot template

November 14, 2015 by Sandeep Bhardwaj | Tags:

Some times when we write some JavaScript on blogspot template we got this error “The entity name must immediately follow the ‘&’ in the entity reference.”This error come if we have some and condition in our JavaScript like if(document.getElementById && !document.all){ // do somethi...

Read more

Create SessionFactory in Hibernate

November 14, 2015 by Sandeep Bhardwaj | Tags:

Hibernate SessionFactory in 4.x import org.hibernate.HibernateException; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; import org.hibernate.service.ServiceRegistryBuilder; public class Hibernate4Util { private static...

Read more

BlockingQueue In Java

November 13, 2015 by Sandeep Bhardwaj | Tags:

public interface BlockingQueue extends Queue A BlockingQueue provides additionally functionality wait for the queue to become non-empty when retrieving an element. wait for space to become available in the queue when storing an element. Implementing Classes: There are 7 implemented cla...

Read more

Usage of LanguageUtil class in Liferay

November 12, 2015 by Sandeep Bhardwaj | Tags:

For fetching properties based on locale from properties file in liferay is easy. Use get() method of com.liferay.portal.kernel.language.LanguageUtil class of liferay. It will automatically pick the correct locale file and return the property value. There are 6 overloaded get methods in LanguageU...

Read more

Custom Annotation for validating a Bean

November 07, 2015 by Sandeep Bhardwaj | Tags:

Custom annotation for validating all the field of a class. If fields are null then display a message containing field name with error message. Annotation package com; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; ...

Read more