ÿþ<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=unicode" /> <meta http-equiv="Content-Language" content="en-us" /> <style> <!-- p.MsoNormal, li.MsoNormal {margin-top:0mm; margin-right:0mm; margin-bottom:10.0pt; margin-left:0mm; line-height:115%; font-size:12.0pt; font-family:"Times New Roman","serif";} h1 {margin-right:0mm; margin-left:0mm; font-size:24.0pt; font-family:"Times New Roman","serif"; font-weight:bold} a:link {color:blue; text-decoration:underline;} a:visited {color:purple; text-decoration:underline;} p {margin-right:0mm; margin-left:0mm; font-size:12.0pt; font-family:"Times New Roman","serif";} ol {margin-bottom:0mm;} --> </style> <title>Creating the Web Pages for Java Hibernate web application</title> <meta name="keywords" content="web, web hosting, Java, opensource, framework, technology, programs, tutorials, examples, database, data" /> <meta name="description" content="Steps on how to create web pages for Java Hibernate web applications using NetBeans IDE" /> </head> <body lang="EN-US" link="#0000FF" vlink="#800080" topmargin="20" leftmargin="20" rightmargin="20" bottommargin="20"> <div class="WordSection1"> <h1 align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;line-height:100%; margin-top:0"><b> <font size="6" face="Arial"><span style="font-weight:bold">Using Hibernate in a Web Application 6</span></font></b></h1> <h1 align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;line-height:100%; margin-top:0"><b> <font size="5" face="Arial"> <span style="font-weight:bold; font-style:italic">(With NetBeans &amp; MySQL)</span></font></b></h1> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0" align="center"><script src="http://tag.contextweb.com/TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=728X90&cwpid=527221&cwwidth=728&cwheight=90&cwpnet=1&cwtagid=85440"></script></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><b><font size="3" face="Arial"> <span style="font-size:12.0pt;font-weight:bold">Creating the Web Pages</span></font></b></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">In this exercise you will create two web pages for displaying the data. You will modify the </span></font><font face="Courier New"> <span style="font-family: &quot;Arial&quot;">index.xhtml</span></font><font face="Arial"> generated by the IDE to add a table that displays the films in the database. You will then create </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;; font-weight:700">browse.xhtml</span></font><font face="Arial"> to display a film&#39;s details when you click the &quot;View&quot; link in the table. You will also create a JSF template page that is used by </font> <font face="Courier New"> <span style="font-family:&quot;Arial&quot;; font-weight:700">index.xhtml</span></font><font face="Arial"> and </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">browse.xhtml</span></font><font face="Arial">.</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><b><font size="3" face="Arial"> <span style="font-size:12.0pt;font-weight:bold">Creating </span></font> <font face="Courier New"> <span style="font-family:&quot;Arial&quot;;font-weight:bold">template.xhtml</span></font></b></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">You will first create the JSF Facelets template </span></font> <font face="Courier New"><span style="font-family:&quot;Arial&quot;">template.xhtml</span></font><font face="Arial"> that is used in the composition of the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">index.xhtml</span></font><font face="Arial"> and </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">browse.xhtml</span></font><font face="Arial"> pages.</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <ol style="margin-top:0mm" start="1" type="1"> <li class="MsoNormal" style="margin-bottom:0mm;margin-bottom:.0001pt;line-height: normal"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Right-click DVDStore in the Projects window and choose New &gt; Other.</span></font></p> </li> </ol> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;line-height:100%; margin-top:0"><font size="3" face="Arial"> <span style="font-size:12.0pt"> <img border="0" width="583" height="378" src="hibernateormnetbean_files/javahibernateormdbaseweb061.png" alt="Creating new JSF faces" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <ol style="margin-top:0mm" start="2" type="1"> <li class="MsoNormal" style="margin-bottom:0mm;margin-bottom:.0001pt;line-height: normal"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Select Facelets Template in the JavaServer Faces category. Click Next.</span></font></p> </li> </ol> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;line-height:100%; margin-top:0"><font size="3" face="Arial"> <span style="font-size:12.0pt"> <img border="0" width="628" height="448" src="hibernateormnetbean_files/javahibernateormdbaseweb062.png" alt="Selecting new JSF Facelets template" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <ol style="margin-top:0mm" start="3" type="1"> <li class="MsoNormal" style="margin-bottom:0mm;margin-bottom:.0001pt;line-height: normal"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Type <b> <span style="font-weight:bold">template</span></b> for the File Name and choose the first CSS layout style.</span></font></p> </li> </ol> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;line-height:100%; margin-top:0"><font size="3" face="Arial"> <span style="font-size:12.0pt"> <img border="0" width="602" height="519" src="hibernateormnetbean_files/javahibernateormdbaseweb063.png" alt="Choosing the CSS template" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <ol style="margin-top:0mm" start="4" type="1"> <li class="MsoNormal" style="margin-bottom:0mm;margin-bottom:.0001pt;line-height: normal"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Click Finish. When you click Finish, the file </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;; font-weight:700">template.xhtml</span></font><font face="Arial"> opens in the editor. The template contains the following default code.</font></p> </li> </ol> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&lt;h:body&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; &lt;div id=&quot;top&quot; class=&quot;top&quot;&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ui:insert name=&quot;top&quot;&gt;Top&lt;/ui:insert&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; &lt;/div&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; &lt;div id=&quot;content&quot; class=&quot;center_content&quot;&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ui:insert name=&quot;content&quot;&gt;Content&lt;/ui:insert&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; &lt;/div&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&lt;/h:body&gt;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;line-height:100%; margin-top:0"><font size="3" face="Arial"> <span style="font-size:12.0pt"> <img border="0" width="725" height="470" src="hibernateormnetbean_files/javahibernateormdbaseweb064.png" alt="The file template.xhtml opens and viewed in the editor" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <ol style="margin-top:0mm" start="5" type="1"> <li class="MsoNormal" style="margin-bottom:0mm;margin-bottom:.0001pt;line-height: normal"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Modify the </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">&lt;ui:insert&gt;</span></font><font face="Arial"> element to change the default generated name to &quot;body&quot;.</font></p> </li> </ol> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&lt;div id=&quot;content&quot; class=&quot;center_content&quot;&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ui:insert name=&quot;<b><span style="font-weight:bold">body</span></b>&quot;&gt;Content&lt;/ui:insert&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:54.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&lt;/div&gt;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;line-height:100%; margin-top:0"><font size="3" face="Arial"> <span style="font-size:12.0pt"> <img border="0" width="472" height="272" src="hibernateormnetbean_files/javahibernateormdbaseweb065.png" alt="Modifying the &lt;ui:insert&gt; element to change the default generated name to body" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <ol style="margin-top:0mm" start="6" type="1"> <li class="MsoNormal" style="margin-bottom:0mm;margin-bottom:.0001pt;line-height: normal"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Save your changes.</span></font></p> </li> </ol> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">The content enclosed within the </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">&lt;ui:define name=&quot;body&quot;&gt;</span></font><font face="Arial"> element in </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">index.xhtml</span></font><font face="Arial"> and </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">browse.xhtml</span></font><font face="Arial"> will be inserted into the location identified with </font> <font face="Courier New"><span style="font-family:&quot;Arial&quot;">&lt;ui:insert name=&quot;body&quot;&gt;Content&lt;/ui:insert&gt;</span></font><font face="Arial"> in the template.</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><b><font size="3" face="Arial"> <span style="font-size:12.0pt; font-weight:bold">Modifying </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;;font-weight:bold">index.xhtml</span></font></b></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">When you created the web application, the IDE automatically generated the page </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">index.xhtml</span></font><font face="Arial">. In this exercise you modify the page to display a list of film titles. The JSF page calls the methods in the JSF Managed Bean FilmController to retrieve the list of films and then displays a table with the film titles and descriptions.</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <ol style="margin-top:0mm" start="1" type="1"> <li class="MsoNormal" style="margin-bottom:0mm;margin-bottom:.0001pt;line-height: normal"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Expand the Web Pages folder in the Projects window and open </span></font> <font face="Courier New"><span style="font-family:&quot;Arial&quot;">index.xhtml</span></font><font face="Arial"> in the editor. The New Project wizard generated the following default </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">index.xhtml</span></font><font face="Arial"> page.</font></p> </li> </ol> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns:h=&quot;http://java.sun.com/jsf/html&quot;&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&lt;h:head&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title&gt;Facelet Title&lt;/title&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; &lt;/h:head&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; &lt;h:body&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hello from Facelets</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; &lt;/h:body&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&lt;/html&gt;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0; line-height:100%; margin-top:0"> <font size="3" face="Arial"><span style="font-size:12.0pt;line-height:115%">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center; line-height:100%; margin-top:0"><font size="3" face="Arial"> <span style="font-size: 12.0pt;line-height:115%"> <img border="0" width="631" height="276" src="hibernateormnetbean_files/javahibernateormdbaseweb066.png" alt="The New Project wizard generated default index.xhtml page" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0; line-height:100%; margin-top:0"> <font size="3" face="Arial"><span style="font-size:12.0pt;line-height:115%">&nbsp;</span></font></p> <ol style="margin-top:0mm" start="2" type="1"> <li class="MsoNormal" style="margin-bottom:0mm;margin-bottom:.0001pt;line-height: normal"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Modify the page to use the JSF </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">&lt;ui:composition&gt;</span></font><font face="Arial"> and </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">&lt;ui:define&gt;</span></font><font face="Arial"> elements and add a </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">&lt;h:form&gt;</span></font><font face="Arial"> element.</font></p> </li> </ol> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp; xmlns:h=&quot;http://java.sun.com/jsf/html&quot;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp; <b> <span style="font-weight:bold">xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot;&gt;</span></b></span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp; &lt;ui:composition template=&quot;./template.xhtml&quot;&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ui:define name=&quot;body&quot;&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:form&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/h:form&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ui:define&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp; &lt;ui:composition&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:54.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&lt;/html&gt;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0" align="center"><script type="text/javascript"><!-- google_ad_client = "pub-8089415323104206"; /* 300x250, created 5/16/08javaos */ google_ad_slot = "8146009330"; google_ad_width = 300; google_ad_height = 250; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0" align="center"><font face="Arial"> ------------------------------------------------------------</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;line-height:100%; margin-top:0"><font size="3" face="Arial"> <span style="font-size:12.0pt"> <img border="0" width="445" height="338" src="hibernateormnetbean_files/javahibernateormdbaseweb067.png" alt="Modifying the page to use the JSF &lt;ui:composition&gt; and &lt;ui:define&gt; elements and adding a &lt;h:form&gt; element" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Arial"><span style="font-size:12.0pt">When you start typing the tags, the IDE adds </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot;</span></font><font face="Arial"> tag library declaration.</font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:36.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Arial"><span style="font-size:12.0pt">The </span> </font><font face="Courier New"><span style="font-family:&quot;Arial&quot;"> &lt;ui:composition&gt;</span></font><font face="Arial"> and </font> <font face="Courier New"><span style="font-family:&quot;Arial&quot;">&lt;ui:define&gt;</span></font><font face="Arial"> elements are used in combination with the page template that you will create. The </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">&lt;ui:composition&gt;</span></font><font face="Arial"> element references the location of the template that will be used by this page. The </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">&lt;ui:define&gt;</span></font><font face="Arial"> element references the position in the template that the enclosed code will occupy. In order to invoke tag library declaration automatic insertion, you need to type part of the element manually instead of copy and paste it.</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <ol style="margin-top:0mm" start="3" type="1"> <li class="MsoNormal" style="margin-bottom:0mm;margin-bottom:.0001pt;line-height: normal"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Add the following navigation links that call the </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">previous</span></font><font face="Arial"> and </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">next</span></font><font face="Arial"> methods in the JSF managed bean.</font></p> </li> </ol> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; &lt;ui:define name=&quot;body&quot;&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:form&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style="font-weight:bold">&lt;h:commandLink action=&quot;#{filmController.previous}&quot; value=&quot;Previous #{filmController.pageSize}&quot; rendered=&quot;#{filmController.hasPreviousPage}&quot;/&gt; </span></b></span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:commandLink action=&quot;#{filmController.next}&quot; value=&quot;Next #{filmController.pageSize}&quot; rendered=&quot;#{filmController.hasNextPage}&quot;/&gt; </span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/h:form&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:99.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&lt;/ui:define&gt;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;line-height:100%; margin-top:0"><font size="3" face="Arial"> <span style="font-size:12.0pt"> <img border="0" width="745" height="340" src="hibernateormnetbean_files/javahibernateormdbaseweb068.png" alt="Adding the navigation links that call the previous and next methods in the JSF managed bean" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <ol style="margin-top:0mm" start="4" type="1"> <li class="MsoNormal" style="margin-bottom:0mm;margin-bottom:.0001pt;line-height: normal"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Add the following </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">dataTable</span></font><font face="Arial"> element (in bold) to generate the table to display the retrieved items. You may need to type manually, the </font><font face="Courier New"> <span style="font-family: &quot;Arial&quot;">&lt;f:facet&gt;</span></font><font face="Arial"> tag, so that the IDE will add </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">xmlns:f=&quot;http://java.sun.com/jsf/core</span></font><font face="Arial"> tag library declaration.</font></p> </li> </ol> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:form styleClass=&quot;jsfcrud_list_form&quot;&gt;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:commandLink action=&quot;#{filmController.previous}&quot; value=&quot;Previous #{filmController.pageSize}&quot; rendered=&quot;#{filmController.hasPreviousPage}&quot;/&gt; </span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:commandLink action=&quot;#{filmController.next}&quot; value=&quot;Next #{filmController.pageSize}&quot; rendered=&quot;#{filmController.hasNextPage}&quot;/&gt; </span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style="font-weight:bold">&lt;h:dataTable value=&quot;#{filmController.filmTitles}&quot; var=&quot;item&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; rowClasses=&quot;jsfcrud_odd_row,jsfcrud_even_row&quot; rules=&quot;all&quot; style=&quot;border:solid 1px&quot;&gt;</span></b></span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:column&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;f:facet name=&quot;header&quot;&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:outputText value=&quot;Title&quot;/&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/f:facet&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:outputText value=&quot;#{item.title}&quot;/&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/h:column&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:column&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;f:facet name=&quot;header&quot;&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:outputText value=&quot;Description&quot;/&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/f:facet&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:outputText value=&quot;#{item.description}&quot;/&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/h:column&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:column&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;f:facet name=&quot;header&quot;&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:outputText value=&quot; &quot;/&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/f:facet&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;h:commandLink action=&quot;#{filmController.prepareView}&quot; value=&quot;View&quot;/&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/h:column&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/h:dataTable&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"><b> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;br/&gt;</span></font></b></p> <p class="MsoNormal" style="margin-top:0;margin-right:0mm;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;line-height:100%"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/h:form&gt;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;line-height:100%; margin-top:0"><font size="3" face="Arial"> <span style="font-size:12.0pt"> <img border="0" width="735" height="479" src="hibernateormnetbean_files/javahibernateormdbaseweb069.png" alt="Adding dataTable element (in bold) to generate the table to display the retrieved items" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <ol style="margin-top:0mm" start="5" type="1"> <li class="MsoNormal" style="margin-bottom:0mm;margin-bottom:.0001pt;line-height: normal"> <p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Save your changes.</span></font></p> </li> </ol> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0"><font size="3" face="Arial"><span style="font-size:12.0pt">The index page will now display a list of film titles in the database. Each row in the table includes a &quot;View&quot; link that invokes the </span></font> <font face="Courier New"><span style="font-family:&quot;Arial&quot;">prepareView</span></font><font face="Arial"> method in the managed bean. The </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">prepareView</span></font><font face="Arial"> method returns &quot;browse&quot; and will open </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">browse.xhtml</span></font><font face="Arial">.</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0" align="center"><script type="text/javascript"><!-- google_ad_client = "pub-8089415323104206"; /* 728x15, created 5/16/08javaos */ google_ad_slot = "3545464564"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></p> <hr color="#FF0000" /> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0; line-height:100%; margin-top:0" align="center"> <font face="Arial" size="5"> <a title="Adding Additional Helper Methods" target="_top" href="http://www.visualcplusdotnet.com/javaopensource/hibernateormnetbean4.html"> Java, ORM &amp; Hibernate 5</a> | <a title="The Java and open source applications" target="_top" href="http://www.javaguicodexample.com/"> Back to Main</a> | <a title="Creating browse.xhtml" target="_top" href="http://www.visualcplusdotnet.com/javaopensource/hibernateormnetbean6.html"> Java, ORM &amp; Hibernate 7</a></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;line-height: 100%; margin-top:0" align="center"><script type="text/javascript"><!-- google_ad_client = "pub-8089415323104206"; /* 728x90, created 5/16/08 javaos */ google_ad_slot = "1917524460"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></p> </div> </body> </html>