Loading CSS JS Resources in JSF

  <?xml version=”1.0″ encoding=”UTF-8″?> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml” xmlns:h=”http://java.sun.com/jsf/html” xmlns:ui=”http://java.sun.com/jsf/facelets”> <h:head> <h:outputStylesheet name=”basetemplate.css” library=”css”/>

Continue reading »

Catching Primefaces form elements in jquery and preventing copy paste and cut operations

xhtml <p:inputText id="firstName" placeholder="#{msg.member_name}" value="#{memberController.order.firstName}" size="30" maxlength="30" widgetVar="firstNameVar" required="true" styleClass="#{not component.valid ? 'ui-input-invalid default-input-text' : 'default-input-text'}" onkeypress="return disallowNonAlphabethCharacters(event);"> <p:ajax delay="1000"

Continue reading »

Hibernate C3P0 pooling integration

hibernate.cfg.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!– Hibernate Settings –> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>

Continue reading »