November 14, 2015 by Sandeep Bhardwaj | Tags: JavaScript
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 moreNovember 14, 2015 by Sandeep Bhardwaj | Tags: Hibernate
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 moreNovember 13, 2015 by Sandeep Bhardwaj | Tags: Concurrency
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 moreNovember 12, 2015 by Sandeep Bhardwaj | Tags: Liferay
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 moreNovember 07, 2015 by Sandeep Bhardwaj | Tags: Java
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