{"id":66425,"date":"2021-07-19T04:10:04","date_gmt":"2021-07-19T08:10:04","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/jsf-lesson-2-jsf-managed-beans-java-short-notes\/"},"modified":"2021-07-19T04:10:04","modified_gmt":"2021-07-19T08:10:04","slug":"jsf-lesson-2-jsf-managed-beans-java-short-notes","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=66425","title":{"rendered":"JSF: Lesson &#8211; 2: JSF Managed Beans #Java Short Notes"},"content":{"rendered":"<p> <a href='codes\/jsf\/JsfManagedBean3.rar'>Codes for this article<\/a> <br \/><a href='http:\/\/www.justetc.net\/knowledge\/multimedia_training\/displayArticle.php?table=TrainingVideos&amp;articleID=8'>Video Demonstration for this article<\/a> <\/p>\n<ul>\n<li>  Target: Intermediate level programmers and web-developers. Any programmer\/web-developer can take a look.    <\/li>\n<li> Pre-requisite: HTML, JSP, Servlet, Tomcat, J2EE, MVC, and     <a href='http:\/\/www.justetc.net\/knowledge\/displayArticle.php?table=Articles&amp;articleID=869'>JSF Introduction<\/a>. Check the corresponding sections of this web-site, to have an idea on the required technology knowledge   <\/li>\n<li> Pre-requisite: <a href='codes\/jsf\/test.rar'>Download this sample JSF application<\/a>   <\/li>\n<li> Beans used by JSF enabled applications are called managed beans as they are created and managed by JSF   <\/li>\n<li> JSF is based on the MVC architecture where beans provide the models    <\/li>\n<li> To be used with JSF, a bean must have a no argument constructor. The bean can expose its properties with get or set methods for reading or writing from outside     <\/li>\n<li> Beans can be used in two ways in JSF applications: The information required to create managed beans are provided in the configuration file (faces-config.xml), JSF uses value binding expressions or method binding expressions, to refer to the properties of the managed beans.   <\/li>\n<li> <b>Configuring Managed Beans<\/b>\n<ul>\n<li> Beans are configured in the faces-config.xml file. The file is usually provided under WEB-INF folder. Though from the web.xml file (using the javax.faces.CONFIG_FILES context parameter), you can refer to any other file where the configuration is provided.      <\/li>\n<li> META-INF\/faces-config.xml file can also be used        <\/li>\n<li> Multiple configuration files can also  be used. The file names should be mentioned in the web.xml file.      <\/li>\n<li> <b>Initialize Bean Properties<\/b>\n<ul>\n<li> Tags such as, value, null-value, list-entries, map-entries can be used to initialize bean properties in the configuration file. value can be used to set String type parameter, null-value is used to set an Object type property to null, list-entries is used to initialize a List type property, map-entries is used to initialize a Map type property. <a href='codes\/jsf\/mb_initialize.txt'>Check this file for examples &#8211; the target audience I assume have the background to understand it just by checking<\/a>         <\/li>\n<\/ul>\n<\/li>\n<li> <b>Accessing Bean properties<\/b>\n<ul>\n<li> Bind managed bean methods to expressions in JSP pages              <\/li>\n<li>   or   : set flight property as the control is a JSF input control            <\/li>\n<li>  or : Retrieve value from the origin property.             <\/li>\n<li> Access list property values: #{bus.times[&#8220;1&#8221;]}            <\/li>\n<li> Access Map property values: flight.airportNames.key, flight.airportNames[key]             <\/li>\n<li> Similarly, you can also bind managed bean methods to expressions in JSP pages.           <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p> From: http:\/\/sitestree.com\/?p=4993<br \/> Categories:Java Short Notes<br \/>Tags:<br \/> Post Data:2010-10-14 11:11:25<\/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>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 sample JSF application Beans used &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=66425\">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-66425","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":66425,"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":66425,"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":66425,"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":76114,"url":"http:\/\/bangla.sitestree.com\/?p=76114","url_meta":{"origin":66425,"position":3},"title":"jsf managed bean","author":"Sayed","date":"May 26, 2024","format":false,"excerpt":"https:\/\/youtu.be\/0TPEQde_TM8","rel":"","context":"In &quot;From Youtube Channel&quot;","block_context":{"text":"From Youtube Channel","link":"http:\/\/bangla.sitestree.com\/?cat=1952"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/img.youtube.com\/vi\/0TPEQde_TM8\/0.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":66429,"url":"http:\/\/bangla.sitestree.com\/?p=66429","url_meta":{"origin":66425,"position":4},"title":"JSF: Lesson &#8211; 4: Accessing Context Data from Beans #Java Short Notes","author":"Author-Check- Article-or-Video","date":"July 19, 2021","format":false,"excerpt":"In some cases, from the beans used in JSF applications, you will need to access the request parameters. For example, in the BusSearch.java, we accessed, the request parameters [Please check the previous JSF lesson]. How to access: FacesContext context = FacesContext.getCurrentInstance(); Some methods of FacesContext: Map getApplicationMap() String getInitParameter(java.lang.String name)\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":66427,"url":"http:\/\/bangla.sitestree.com\/?p=66427","url_meta":{"origin":66425,"position":5},"title":"JSF: Lesson &#8211; 3: Controlling Page Navigation in JSF #Java Short Notes","author":"Author-Check- Article-or-Video","date":"July 19, 2021","format":false,"excerpt":"Sample application for this article Video Tutorial for this article Pre-requisite: JSF Lesson 1 & 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 \"action\" attribute for a JSF event control\/action element\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":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/66425","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=66425"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/66425\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=66425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=66425"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=66425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}