How to make a redirection on page load in JSF 1.x

Set the GET query parameters as managed properties in faces-config.xml so that you don’t need to gather them manually: <managed-bean> <managed-bean-name>forward</managed-bean-name> <managed-bean-class>com.example.ForwardBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>action</property-name> <value>#{param.action}</value> </managed-property> <managed-property> <property-name>actionParam</property-name> <value>#{param.actionParam}</value> </managed-property> </managed-bean> This way the request forward.jsf?action=outcome1&actionParam=123 will let JSF set the action and actionParam parameters as action and actionParam properties of the ForwardBean. Create … Read more

Input fields hold previous values only if validation failed

This problem is in JSF 2 also recognized and explained in detail in the following answer: How can I populate a text field using PrimeFaces AJAX after validation errors occur? If you were using JSF 2, you could have used OmniFaces’ ResetInputAjaxActionListener or PrimeFaces’ <p:resetInput> or resetValues=”true” for this. To the point, you need to … Read more