{"id":66427,"date":"2021-07-19T04:10:05","date_gmt":"2021-07-19T08:10:05","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/jsf-lesson-3-controlling-page-navigation-in-jsf-java-short-notes\/"},"modified":"2021-07-19T04:10:05","modified_gmt":"2021-07-19T08:10:05","slug":"jsf-lesson-3-controlling-page-navigation-in-jsf-java-short-notes","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=66427","title":{"rendered":"JSF: Lesson &#8211; 3: Controlling Page Navigation in JSF #Java Short Notes"},"content":{"rendered":"<ul>\n<li> <a href='codes\/jsf\/navigationRules.rar'>Sample application for this article<\/a>      <\/li>\n<li> <a href='http:\/\/www.justetc.net\/knowledge\/multimedia_training\/displayArticle.php?table=TrainingVideos&amp;articleID=9'>Video Tutorial for this article<\/a>      <\/li>\n<li> Pre-requisite:  JSF Lesson 1 &amp; 2      <\/li>\n<li> <b>Navigation: Two Types:<\/b>\n<ul>\n<li> Static: The destination page is fixed          <\/li>\n<li> Dynamic: The destination page varies with the conditions      <\/li>\n<\/ul>\n<ul>\n<li> <b>Static<\/b>\n<ul>\n<li> Static: You provide a fixed value for the &#8220;action&#8221; attribute for a JSF event control\/action element      <\/li>\n<li> That fixed value is mapped to the fixed destination page in the configuration file such as the faces-config.xml       <\/li>\n<li> If you check our previous lesson, the searchForms.jsp contains . In this line, the text &#8216;action=&#8221;submit&#8221;&#8216; defines the static navigation.       <\/li>\n<li> The navigation rule in the following text maps submit action to searchResults.jsp page [static\/fixed mappping] <br \/>      \/searchForm.jsp\n<p>         submit<br \/>         \/searchResults.jsp<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li> <b>Dynamic Navigation<\/b>\n<ul>\n<li> In this case, the action takes a dynamic value. All possible values are mapped into [different] destination pages. Hence, when the action gets a different value, the destination page is also different [unless mapped to the same destination page]        <\/li>\n<li> To get dynamic nature, the action is mapped to a value\/property or a method of a managed bean. The property must be of String type. Also, the method must return String and must not take any parameter.      <\/li>\n<li> At the time, the action is executed [the button is pressed], corresponding property value is retrieved or the method is called to get value. This value is then matched with the navigation cases in faces-config.xml.      <\/li>\n<li> The user is then redirected to the destination of the mathching navigation case.       <\/li>\n<li> Example: Binding action to a value\/method expression in jsp:       . Here, search is a method in the bus bean. Hence, at the button click, the search method is executed. For example, it may get values such as success, noTrips <\/li>\n<li> Mapping in faces-config.xml: success, and noTrips are mapped in the following navigation cases. <\/li>\n<li>    \/searchForm.jsp\n<p>      success<br \/>      \/searchResults.jsp<\/p>\n<p>      noTrips<br \/>      \/noTrips.jsp<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li> <b>Navigation Rules:<\/b>\n<ul>\n<li> If you observe the navigation rules above, you will notice  elements. This is to mention, from where the action is generated.        <\/li>\n<li> : is the action message based on which flow is maintained        <\/li>\n<li>   element provides the destination page         <\/li>\n<li>  is optional. If you omit , then for all &lt;from -outcome&amp;gt message for the application, will be redirected to the  related  destination page. If all page refers to the same privacy policy file, this rule can be useful        <\/li>\n<li>Example:\n<p>    privacy-policy<br \/>    \/WEB-INF\/privacy.jsp<\/p>\n<p><\/li>\n<li> You can also redirect for the same  message for a group of pages to the same destiation. Such as: <br \/>\/order\/*<br \/>success<br \/>\/WEB-INF\/invoice.jsp<\/li>\n<li>  element: Consider a case, in the same page, in two command buttons, the actions are mapped to save and search methods. Both save and search methods can return success as the  element. But, if you want them (two successes from the two methods) to go to two different destination pages, then  element comes handy.<\/li>\n<li> You can use  element in the following way:<\/li>\n<li>  \/searchForm.jsp\n<p>    #{bus.search}<br \/>    success<br \/>    \/searchResults.jsp<\/p>\n<p>    #{bus.save}<br \/>    success<br \/>    \/searchForm.jsp<\/p>\n<p>     <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<li> Now check the sample example and the video.       <\/li>\n<p> From: http:\/\/sitestree.com\/?p=4994<br \/> Categories:Java Short Notes<br \/>Tags:<br \/> Post Data:2012-08-07 12:03:08<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sample application for this article Video Tutorial for this article Pre-requisite: JSF Lesson 1 &amp; 2 Navigation: Two Types: Static: The destination page is fixed Dynamic: The destination page varies with the conditions Static Static: You provide a fixed value for the &#8220;action&#8221; attribute for a JSF event control\/action element That fixed value is mapped &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=66427\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-66427","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":66423,"url":"http:\/\/bangla.sitestree.com\/?p=66423","url_meta":{"origin":66427,"position":0},"title":"JSF: Lesson &#8211; 1: JSF Specifications #Java Short Notes","author":"Author-Check- Article-or-Video","date":"July 19, 2021","format":false,"excerpt":"Video Demonstration of a sample JSF application create: Read the article first JSF Specifications JSF is not standalone technology, you have to use it in conjunction with JSPs, Servlets, EJBs How to use JSF with Servlets and EJBs: In Servlet or EJB, explicitly create instances of UI components and use\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":74778,"url":"http:\/\/bangla.sitestree.com\/?p=74778","url_meta":{"origin":66427,"position":1},"title":"JSF: Java Server Faces Short Notes from the past","author":"Sayed","date":"May 31, 2022","format":false,"excerpt":"JSF: Java Server Faces Short Notes from the past http:\/\/bangla.salearningschool.com\/recent-posts?s=jsf Data conversion in jsf applications 2022\/04\/15 at 10:01 am 0 views Select internationalization in jsf #AngularJS #By Sayed Ahmed internationalization in jsf #AngularJS #By Sayed Ahmed 2021\/08\/02 at 4:10 am 0 views Select data conversion in jsf applications #AngularJS #By\u2026","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":74781,"url":"http:\/\/bangla.sitestree.com\/?p=74781","url_meta":{"origin":66427,"position":2},"title":"Playlist: Anything Java","author":"Sayed","date":"May 31, 2022","format":false,"excerpt":"Playlist: Anything Java: https:\/\/www.youtube.com\/playlist... #SaLearningSchoolShopForSoulSitesTree, #SaLearningSchool, #ShopForSoul, #SitesTree Starting Java training basic file operations in java basic java language concepts bengali javascript debugging data conversion in jsf applications debugging javascript code Docker and Vagrant Optional Java and\/or PHP Platform ejb application with bea weblogic eclipse experiment eclipse ant how to\u2026","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":66425,"url":"http:\/\/bangla.sitestree.com\/?p=66425","url_meta":{"origin":66427,"position":3},"title":"JSF: Lesson &#8211; 2: JSF Managed Beans #Java Short Notes","author":"Author-Check- Article-or-Video","date":"July 19, 2021","format":false,"excerpt":"Codes for this article Video Demonstration for this article Target: Intermediate level programmers and web-developers. Any programmer\/web-developer can take a look. Pre-requisite: HTML, JSP, Servlet, Tomcat, J2EE, MVC, and JSF Introduction. Check the corresponding sections of this web-site, to have an idea on the required technology knowledge Pre-requisite: Download this\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":66433,"url":"http:\/\/bangla.sitestree.com\/?p=66433","url_meta":{"origin":66427,"position":4},"title":"JSF: Lesson &#8211; 6: Validating User Input in JSF #Java Short Notes","author":"Author-Check- Article-or-Video","date":"July 19, 2021","format":false,"excerpt":"Target: Intermediate level web-developers. Sample application for this article Video Tutorial for this article In web-application development, validating user inputs takes much efforts. JSF has made validations much easier than usual JSF Built-in Validators: validateDoubleRange: Checks that the value provided is a double value. You can also set a minimum\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":23427,"url":"http:\/\/bangla.sitestree.com\/?p=23427","url_meta":{"origin":66427,"position":5},"title":"navigation control in jsf j2ee applications #Root","author":"Author-Check- Article-or-Video","date":"March 31, 2021","format":false,"excerpt":"\u00a0 From: http:\/\/sitestree.com\/?p=2754 Categories:RootTags: Post Data:2015-10-25 05:23:26 Shop Online: https:\/\/www.ShopForSoul.com\/ (Big Data, Cloud, Security, Machine Learning): Courses: http:\/\/Training.SitesTree.com In Bengali: http:\/\/Bangla.SaLearningSchool.com http:\/\/SitesTree.com 8112223 Canada Inc.\/JustEtc: http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) Shop Online: https:\/\/www.ShopForSoul.com\/ Medium: https:\/\/medium.com\/@SayedAhmedCanada","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/66427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=66427"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/66427\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=66427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=66427"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=66427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}