Thursday, December 11, 2014

Why my JSF navigation failed - for beginners in JSF

JSF navigation did not work for me with the following content

<!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">
      from page2.xhtml
      <h:commandButton action="home" value="go to home" />
</html>

Caused a standstill since it did not emit any error in logs.

Since <h:commandButton> produces the html <input type='submit' />, it is supposed to be inside a form. So made the correction and it worked.

<!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">
      from page2.xhtml
      <body>
       <h:form>
      <h:commandButton action="home" value="go to home" />
       </h:form>
      </body>
</html>

Thursday, December 4, 2014

An excellent article which explains the basics of configuring a JSF application without using any IDE

If you know JSP and are looking for some help to get started on the basics of JSF without using any IDE or build tool (most tutorials use maven, but for those who have no maven knowledge, many things remain hidden), here is yours :

http://www.theserverside.com/tutorial/Slingshot-Yourself-into-JavaServer-Faces-20-Learning-JSF

Once you complete your JSF setup using the above link, then you can use http://www.tutorialspoint.com/jsf/ to explore further.