{"id":1141,"date":"2012-04-05T10:49:00","date_gmt":"2012-04-05T10:49:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/5-useful-methods-jsf-developers-should-know.html"},"modified":"2014-11-27T21:34:49","modified_gmt":"2014-11-27T19:34:49","slug":"5-useful-methods-jsf-developers-should","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html","title":{"rendered":"5 useful methods JSF developers should know"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">The aim of this post is a summary about some handy methods for JSF developers they can use in their day-to-day work. An utility class is a good place to put all methods together. I would call such class FacesAccessor. The first method is probably the most used one. It returns managed bean by the given name. <\/p>\n<p>The bean must be registered either per faces-config.xml or annotation. Injection is good, but sometimes if beans are rare called, it&#8217;s not necessary to inject beans into each other.<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<pre class=\"brush:java\">public static Object getManagedBean(final String beanName) {\r\n    FacesContext fc = FacesContext.getCurrentInstance();\r\n    Object bean;\r\n    \r\n    try {\r\n        ELContext elContext = fc.getELContext();\r\n        bean = elContext.getELResolver().getValue(elContext, null, beanName);\r\n    } catch (RuntimeException e) {\r\n        throw new FacesException(e.getMessage(), e);\r\n    }\r\n\r\n    if (bean == null) {\r\n        throw new FacesException(\"Managed bean with name '\" + beanName\r\n            + \"' was not found. Check your faces-config.xml or @ManagedBean annotation.\");\r\n    }\r\n\r\n    return bean;\r\n}\r\n<\/pre>\n<p><u>Using: <\/u><\/p>\n<pre class=\"brush:java\">@ManagedBean\r\npublic class PersonBean {\r\n    ...\r\n}\r\n\r\nPersonBean personBean = (PersonBean)FacesAccessor.getManagedBean(\"personBean\");\r\n\r\n\/\/ do something with personBean\r\n<\/pre>\n<p>The second method is useful for JSF component developers and everyone who would like to evaluate the given value expression #{&#8230;} and sets the result to the given value.  <\/p>\n<pre class=\"brush:java\">public static void setValue2ValueExpression(final Object value, final String expression) {\r\n    FacesContext facesContext = FacesContext.getCurrentInstance();\r\n    ELContext elContext = facesContext.getELContext();\r\n\r\n    ValueExpression targetExpression = \r\n        facesContext.getApplication().getExpressionFactory().createValueExpression(elContext, expression, Object.class);\r\n    targetExpression.setValue(elContext, value);\r\n}\r\n<\/pre>\n<p><u>Using:&nbsp;<\/u><br \/>\nI personally use this method for the &#8220;log off functionality&#8221;. After an user is logged off, he\/she will see a special &#8220;logoff page&#8221;. The &#8220;logoff page&#8221; uses user settings (e.g. theme, language, etc.) from a sesion scoped bean. But this session scoped bean doesn&#8217;t exist more because the session was invalidated. What to do? Here is the code snippet from my logout method. <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush:java\">UserSettings userSettings = (UserSettings) FacesAccessor.getManagedBean(\"userSettings\");\r\n\r\n\/\/ invalidate session\r\nExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();\r\nHttpSession session = (HttpSession) ec.getSession(false);\r\nsession.invalidate();\r\n\r\n\/\/ create new session\r\n((HttpServletRequest) ec.getRequest()).getSession(true);\r\n\r\n\/\/ restore last used user settings because login \/ logout pages reference \"userSettings\"\r\nFacesAccessor.setValue2ValueExpression(userSettings, \"#{userSettings}\");\r\n\r\n\/\/ redirect to the specified logout page\r\nec.redirect(ec.getRequestContextPath() + \"\/views\/logout.jsf\");\r\n<\/pre>\n<p>The third method maps a variable to the given value expression #{&#8230;}. It uses javax.el.VariableMapper to assign the expression to the specified variable, so that any reference to that variable will be replaced by the expression in EL evaluations.  <\/p>\n<pre class=\"brush:java\">public static void mapVariable2ValueExpression(final String variable, final String expression) {\r\n    FacesContext facesContext = FacesContext.getCurrentInstance();\r\n    ELContext elContext = facesContext.getELContext();\r\n    \r\n    ValueExpression targetExpression =\r\n        facesContext.getApplication().getExpressionFactory().createValueExpression(elContext, expression, Object.class);\r\n    elContext.getVariableMapper().setVariable(variable, targetExpression);\r\n}\r\n<\/pre>\n<p><u>Using:&nbsp;<\/u><br \/>\nAssume, &#8220;PersonBean&#8221; is a managed bean having &#8220;name&#8221; attribute and &#8220;PersonsBean&#8221; is a bean holding many instances of &#8220;PersonBean&#8221; (as array, collection or map). The following code allows to use &#8220;personBean&#8221; as a reference to a specific bean with &#8220;name&#8221; Oleg. <\/p>\n<pre class=\"brush:java\">FacesAccessor.mapVariable2ValueExpression(\"personBean\", \"#{personsBean.person['Oleg']}\");\r\n<\/pre>\n<p>In a facelets page, say so, personDetail.xhtml, we can write: <\/p>\n<pre class=\"brush:xml\">&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"\r\n      xmlns:ui=\"http:\/\/java.sun.com\/jsf\/facelets\"\r\n      xmlns:h=\"http:\/\/java.sun.com\/jsf\/html\"&gt;\r\n&lt;ui:composition&gt;\r\n    ...\r\n    &lt;h:inputText value=\"#{personBean.name}\"\/&gt;\r\n    ...\r\n&lt;\/ui:composition&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>Note, the reference &#8220;personBean&#8221; was set in Java. This mapping can be also used in facelets in declarative way via ui:include \/ ui:param. <\/p>\n<pre class=\"brush:xml\">&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"\r\n      xmlns:ui=\"http:\/\/java.sun.com\/jsf\/facelets\"&gt;\r\n&lt;ui:composition&gt;\r\n    ...\r\n    &lt;ui:include src=\"personDetail.xhtml\"&gt;\r\n        &lt;ui:param name=\"personBean\" value=\"#{personsBean.person['Oleg']}\"\/&gt;\r\n    &lt;\/ui:include&gt;\r\n    ...\r\n&lt;\/ui:composition&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>The next two methods are used to create MethodExpression \/ MethodExpressionActionListener programmatically. They are handy if you use component binding via &#8220;binding&#8221; attribute or create some model classes in Java. <\/p>\n<pre class=\"brush:java\">public static MethodExpression createMethodExpression(String valueExpression,\r\n                                                      Class&lt;?&gt; expectedReturnType,\r\n                                                      Class&lt;?&gt;[] expectedParamTypes) {\r\n    MethodExpression methodExpression = null;\r\n    try {\r\n        FacesContext fc = FacesContext.getCurrentInstance();\r\n        ExpressionFactory factory = fc.getApplication().getExpressionFactory();\r\n        methodExpression = factory.\r\n            createMethodExpression(fc.getELContext(), valueExpression, expectedReturnType, expectedParamTypes);\r\n    } catch (Exception e) {\r\n        throw new FacesException(\"Method expression '\" + valueExpression + \"' could not be created.\");\r\n    }\r\n    \r\n    return methodExpression;\r\n}\r\n\r\npublic static MethodExpressionActionListener createMethodActionListener(String valueExpression,\r\n                                                                        Class&lt;?&gt; expectedReturnType,\r\n                                                                        Class&lt;?&gt;[] expectedParamTypes) {\r\n    MethodExpressionActionListener actionListener = null;\r\n    try {\r\n        actionListener = new MethodExpressionActionListener(createMethodExpression(\r\n            valueExpression, expectedReturnType, expectedParamTypes));\r\n    } catch (Exception e) {\r\n        throw new FacesException(\"Method expression for ActionListener '\" + valueExpression\r\n                          + \"' could not be created.\");\r\n    }\r\n\r\n    return actionListener;\r\n}\r\n\r\n<\/pre>\n<p><u>Using:&nbsp;<\/u><br \/>\nIn one of my projects I have created PrimeFaces MenuModel with menu items programmatically. <\/p>\n<pre class=\"brush:java\">MenuItem mi = new MenuItem();\r\nmi.setAjax(true);\r\nmi.setValue(...);\r\nmi.setProcess(...);\r\nmi.setUpdate(...);\r\nmi.setActionExpression(FacesAccessor.createMethodExpression(\r\n    \"#{navigationContext.setBreadcrumbSelection}\", String.class, new Class[] {}));\r\n\r\nUIParameter param = new UIParameter();\r\nparam.setId(...);\r\nparam.setName(...);\r\nparam.setValue(...);\r\nmi.getChildren().add(param);\r\n<\/pre>\n<p>Do you have nice methods you want to share here? Tips \/ tricks are welcome.   <\/p>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/ovaraksin.blogspot.com\/2011\/11\/5-useful-methods-jsf-developers-should.html\">5 useful methods JSF developers should know  <\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Oleg Varaksin at the <a href=\"http:\/\/ovaraksin.blogspot.com\/\">Thoughts on software development<\/a> blog. <\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The aim of this post is a summary about some handy methods for JSF developers they can use in their day-to-day work. An utility class is a good place to put all methods together. I would call such class FacesAccessor. The first method is probably the most used one. It returns managed bean by the &hellip;<\/p>\n","protected":false},"author":200,"featured_media":174,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[293],"class_list":["post-1141","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-jsf"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>5 useful methods JSF developers should know - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"The aim of this post is a summary about some handy methods for JSF developers they can use in their day-to-day work. An utility class is a good place to\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"5 useful methods JSF developers should know - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"The aim of this post is a summary about some handy methods for JSF developers they can use in their day-to-day work. An utility class is a good place to\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2012-04-05T10:49:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-27T19:34:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Oleg Varaksin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Oleg Varaksin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html\"},\"author\":{\"name\":\"Oleg Varaksin\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/ac096549ff51a73f2e15f128920ed7e0\"},\"headline\":\"5 useful methods JSF developers should know\",\"datePublished\":\"2012-04-05T10:49:00+00:00\",\"dateModified\":\"2014-11-27T19:34:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html\"},\"wordCount\":391,\"commentCount\":9,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jsf-logo.jpg\",\"keywords\":[\"JSF\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html\",\"name\":\"5 useful methods JSF developers should know - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jsf-logo.jpg\",\"datePublished\":\"2012-04-05T10:49:00+00:00\",\"dateModified\":\"2014-11-27T19:34:49+00:00\",\"description\":\"The aim of this post is a summary about some handy methods for JSF developers they can use in their day-to-day work. An utility class is a good place to\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jsf-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jsf-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/04\\\/5-useful-methods-jsf-developers-should.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"5 useful methods JSF developers should know\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/ac096549ff51a73f2e15f128920ed7e0\",\"name\":\"Oleg Varaksin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fda1ce47105421f7a352a13dbefec14ab59d59ffae99c6c3002e5841578979d3?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fda1ce47105421f7a352a13dbefec14ab59d59ffae99c6c3002e5841578979d3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/fda1ce47105421f7a352a13dbefec14ab59d59ffae99c6c3002e5841578979d3?s=96&d=mm&r=g\",\"caption\":\"Oleg Varaksin\"},\"sameAs\":[\"http:\\\/\\\/ovaraksin.blogspot.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Oleg-Varaksin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"5 useful methods JSF developers should know - Java Code Geeks","description":"The aim of this post is a summary about some handy methods for JSF developers they can use in their day-to-day work. An utility class is a good place to","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html","og_locale":"en_US","og_type":"article","og_title":"5 useful methods JSF developers should know - Java Code Geeks","og_description":"The aim of this post is a summary about some handy methods for JSF developers they can use in their day-to-day work. An utility class is a good place to","og_url":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-04-05T10:49:00+00:00","article_modified_time":"2014-11-27T19:34:49+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","type":"image\/jpeg"}],"author":"Oleg Varaksin","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Oleg Varaksin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html"},"author":{"name":"Oleg Varaksin","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/ac096549ff51a73f2e15f128920ed7e0"},"headline":"5 useful methods JSF developers should know","datePublished":"2012-04-05T10:49:00+00:00","dateModified":"2014-11-27T19:34:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html"},"wordCount":391,"commentCount":9,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","keywords":["JSF"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html","url":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html","name":"5 useful methods JSF developers should know - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","datePublished":"2012-04-05T10:49:00+00:00","dateModified":"2014-11-27T19:34:49+00:00","description":"The aim of this post is a summary about some handy methods for JSF developers they can use in their day-to-day work. An utility class is a good place to","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/04\/5-useful-methods-jsf-developers-should.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"5 useful methods JSF developers should know"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/ac096549ff51a73f2e15f128920ed7e0","name":"Oleg Varaksin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/fda1ce47105421f7a352a13dbefec14ab59d59ffae99c6c3002e5841578979d3?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/fda1ce47105421f7a352a13dbefec14ab59d59ffae99c6c3002e5841578979d3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fda1ce47105421f7a352a13dbefec14ab59d59ffae99c6c3002e5841578979d3?s=96&d=mm&r=g","caption":"Oleg Varaksin"},"sameAs":["http:\/\/ovaraksin.blogspot.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Oleg-Varaksin"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1141","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/200"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=1141"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1141\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/174"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=1141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=1141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=1141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}