Category Archives: java

Mysql JavaConnector options

?zeroDateTimeBehavior=convertToNull
This will handle the all zero Dates problem with mysql

Navigation in JSF

Navigation Rules are specified in faces-config.xml by default.
However, you can assign any other name and even use more than one file to store JSF configuration data. To specify configuration files, use lines like the following in your web.xml file:
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml,/WEB-INF/faces-config2.xml</param-value>
</context-param>
Navigation rules are just like switch case constructs.
For example :
<navigation-rule>
<from-view-id>/pages/input.jsp</from-view-id>
<navigation-case>
<from-outcome>sayHello</from-outcome>
<to-view-id>/pages/greeting.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>sayGoodbye</from-outcome>
<to-view-id>/pages/goodbye.jsp</to-view-id>
</navigation-case>
<navigation-case>
<to-view-id>/pages/default.jsp</to-view-id>
</navigation-case>
</navigation-rule>
is similar in semantics to following Switch case
Switch(output [...]

Facelets Explored

JSF’s Application includes:
a default ActionListener, ELResolver, StateManager, NavigationHandler, and ViewHandler.
Facelets is used as the application’s ViewHandler, represented by the class com.sun.facelets.FaceletViewHandler.
An excellent tutorial for kickstart
https://facelets.dev.java.net/nonav/docs/dev/docbook.html#gettingstarted-dependencies
Points to remember :
1. First you create a template file that will decide the layout of your page in a broader sense. or you can call it default view. Mostly using [...]