{"id":18692,"date":"2013-11-06T01:00:14","date_gmt":"2013-11-05T23:00:14","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=18692"},"modified":"2013-11-05T08:55:06","modified_gmt":"2013-11-05T06:55:06","slug":"implementing-a-custom-jsf-2-0-component-with-maven","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html","title":{"rendered":"Implementing a custom JSF 2.0 component with maven"},"content":{"rendered":"<p>Some time ago, I have written my own custom JSF component. But at that point in time, JSF 1.0 was still up to date and the project didn\u2019t use maven as build system. Thus, I always wanted to write a custom JSF2 component with maven. So let\u2019s start:<\/p>\n<p>First of all we setup a maven project with two modules. Here is the pom.xml file of the parent project:<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<pre class=\" brush:xml\">&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n\txsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/maven-v4_0_0.xsd\"&gt;\r\n\t&lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n\t&lt;groupId&gt;martins-developer-world&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;jsf-component&lt;\/artifactId&gt;\r\n\t&lt;packaging&gt;pom&lt;\/packaging&gt;\r\n\t&lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\r\n\t&lt;name&gt;jsf-component Maven Webapp&lt;\/name&gt;\r\n\t&lt;dependencies&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;junit&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;junit&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;4.11&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;test&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;javax.faces&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;jsf-api&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;2.1&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;provided&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;com.sun.faces&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;jsf-impl&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;2.2.0&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;provided&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;javax.servlet&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;servlet-api&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;2.5&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;provided&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;javax.servlet&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;jsp-api&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;2.0&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;provided&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;javax.servlet&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;jstl&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;1.2&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;provided&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t&lt;\/dependencies&gt;\r\n\t&lt;build&gt;\r\n\t\t&lt;finalName&gt;jsf-component&lt;\/finalName&gt;\r\n\t&lt;\/build&gt;\r\n\t&lt;modules&gt;\r\n\t\t&lt;module&gt;jsf-component-webapp&lt;\/module&gt;\r\n\t\t&lt;module&gt;jsf-component-impl&lt;\/module&gt;\r\n\t&lt;\/modules&gt;\r\n&lt;\/project&gt;<\/pre>\n<p>As you can see, we have added the JSF dependencies in the top level pom.xml, so that we inherit them in the child modules. As we will use the JBoss Application Server to test our web application, we have to set the scope for the maven dependencies to provided, so that our war file and our component jar won\u2019t deploy them. The implementation of our component will reside in jsf-component-impl, thus we chose jar as packaging type for this module:<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:xml\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;project\r\n\txsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"\r\n\txmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"&gt;\r\n\t&lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n\t&lt;parent&gt;\r\n\t\t&lt;groupId&gt;martins-developer-world&lt;\/groupId&gt;\r\n\t\t&lt;artifactId&gt;jsf-component&lt;\/artifactId&gt;\r\n\t\t&lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\r\n\t&lt;\/parent&gt;\r\n\t&lt;artifactId&gt;jsf-component-impl&lt;\/artifactId&gt;\r\n\t&lt;name&gt;jsf-component-impl&lt;\/name&gt;\r\n\t&lt;properties&gt;\r\n\t\t&lt;project.build.sourceEncoding&gt;UTF-8&lt;\/project.build.sourceEncoding&gt;\r\n\t&lt;\/properties&gt;\r\n\t&lt;dependencies&gt;\r\n\t&lt;\/dependencies&gt;\r\n&lt;\/project&gt;<\/pre>\n<p>Now let\u2019s implement a Java class that extends UIOutput. I have chosen UIOutput because as a first step I just want to implement a simple helloWorld tag, that prints the first and last name given as attribute within a span element. As this component doesn\u2019t receive any input, UIOutput it appropriate:<\/p>\n<pre class=\" brush:java\">package martins.developer.world.jsf.component.impl;\r\n\r\nimport java.io.IOException;\r\n\r\nimport javax.faces.application.ResourceDependencies;\r\nimport javax.faces.application.ResourceDependency;\r\nimport javax.faces.component.FacesComponent;\r\nimport javax.faces.component.UIOutput;\r\nimport javax.faces.context.FacesContext;\r\nimport javax.faces.context.ResponseWriter;\r\n\r\n@ResourceDependencies({ @ResourceDependency(name = \"css\/jsf-component.css\", target = \"head\") })\r\n@FacesComponent(\"HelloWorld\")\r\npublic class HelloWorldComponent extends UIOutput {\r\n\tprivate static final String COMPONENT_FAMILY = \"martins.developer.world.jsf.component.helloWorld\";\r\n\r\n\tprivate enum PropertyKeys {\r\n\t\tfirstName, lastName\r\n\t};\r\n\r\n\t@Override\r\n\tpublic String getFamily() {\r\n\t\treturn COMPONENT_FAMILY;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void encodeBegin(FacesContext context) throws IOException {\r\n\t\tResponseWriter writer = context.getResponseWriter();\r\n\t\twriter.startElement(\"span\", this);\r\n\t\twriter.writeAttribute(\"class\", \"helloWorldClass\", \"\");\r\n\t\twriter.writeText(String.format(\"Hello %s %s!\", getFirstName(), getLastName()), \"\");\r\n\t\twriter.endElement(\"span\");\r\n\t}\r\n\r\n\tpublic String getFirstName() {\r\n\t\treturn (String) getStateHelper().eval(PropertyKeys.firstName, \"???firstName???\");\r\n\t}\r\n\r\n\tpublic void setFirstName(String firstName) {\r\n\t\tgetStateHelper().put(PropertyKeys.firstName, firstName);\r\n\t}\r\n\r\n\tpublic String getLastName() {\r\n\t\treturn (String) getStateHelper().eval(PropertyKeys.lastName, \"???lastName???\");\r\n\t}\r\n\r\n\tpublic void setLastName(String lastName) {\r\n\t\tgetStateHelper().put(PropertyKeys.lastName, lastName);\r\n\t}\r\n}<\/pre>\n<p>The getFamily() method is the only method that we are enforced to implement. Interesting is here the method encodeBegin(). This is the place where we implement our span tag. As it should have a CSS class attribute, we add it with the writeAttribute() method of the Writer. The two attributes of the resulting JSF tag are modelled as simple properties with getter and setter methods. The implementation of these getters and setters uses the StateHelper available in JSF 2.0. In encodeBegin() we use the getters to retrieve the value given by the user.<\/p>\n<p>Interesting is also the annotation @ResourceDependencies. With this annotation we can tell the JSF framework that we have some files we depend on. In this case it is a CSS file that resides with the folder src\/main\/resources\/META-INF\/resources\/css.<br \/>\nThe annotation @FacesComponent registers this component in the boot process at the JSF framework. The given name is used in the taglib file to reference this class:<\/p>\n<pre class=\" brush:xml\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;facelet-taglib xmlns=\"http:\/\/java.sun.com\/xml\/ns\/javaee\"&gt;\r\n\t&lt;namespace&gt;http:\/\/martinsdeveloperworld.wordpress.com&lt;\/namespace&gt;\r\n\t&lt;tag&gt;\r\n\t\t&lt;tag-name&gt;helloWorld&lt;\/tag-name&gt;\r\n\t\t&lt;component&gt;\r\n\t\t\t&lt;component-type&gt;HelloWorld&lt;\/component-type&gt;\r\n\t\t&lt;\/component&gt;\r\n\t&lt;\/tag&gt;\r\n&lt;\/facelet-taglib&gt;<\/pre>\n<p>In this taglib file under src\/main\/resources\/META-INF we define the available components, here only our helloWorld tag. The attributes of the tag are derived from the properties of the Java class.<\/p>\n<p>Finally we want to test our newly created component. To be able to do this, we setup a simple JSF2 webapp project and add the following snippet to the web.xml, in order to declare that we want to use our custom component:<\/p>\n<pre class=\" brush:xml\">&lt;context-param&gt;\r\n\t\t&lt;param-name&gt;facelets.FACELETS_LIBRARIES&lt;\/param-name&gt;\r\n\t\t&lt;param-value&gt;\/META-INF\/jsf-component.taglib.xml&lt;\/param-value&gt;\r\n\t&lt;\/context-param&gt;<\/pre>\n<p>Now we can write a simple JSF page that references our new tag:<\/p>\n<pre class=\" brush:xml\">&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\"\r\n   \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\"&gt;\r\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"\r\n\txmlns:f=\"http:\/\/java.sun.com\/jsf\/core\"\r\n\txmlns:h=\"http:\/\/java.sun.com\/jsf\/html\"\r\n\txmlns:mdw=\"http:\/\/martinsdeveloperworld.wordpress.com\"&gt;\r\n&lt;h:head&gt;\r\n&lt;title&gt;Hello JSF 2!&lt;\/title&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n\t&lt;h2&gt;Hello World!&lt;\/h2&gt;\r\n\t&lt;mdw:helloWorld firstName=\"Martin\" lastName=\"Developer\"\/&gt;\r\n&lt;\/h:body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>When we deploy this application to the JBoss Application Server and call the corresponding URL, we get the following HTML output:<\/p>\n<pre class=\" brush:xml\">&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\"&gt;\r\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"&gt;\r\n&lt;head&gt;\r\n\t&lt;title&gt;Hello JSF 2!&lt;\/title&gt;\r\n\t&lt;link type=\"text\/css\" rel=\"stylesheet\" href=\"\/jsf-component-webapp\/faces\/javax.faces.resource\/css\/jsf-component.css\" \/&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\t&lt;h2&gt;Hello World!&lt;\/h2&gt;\r\n\t&lt;span class=\"helloWorldClass\"&gt;Hello Martin Developer!&lt;\/span&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>Clearly we can see the span tag with the CSS class and the output. The CSS file is referenced in the head of the HTML document.<\/p>\n<ul>\n<li>The sources of the whole project can be found on GitHub: <a href=\"https:\/\/github.com\/siom79\/jsf-component\" rel=\"nofollow\">https:\/\/github.com\/siom79\/jsf-component<\/a>.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/martinsdeveloperworld.wordpress.com\/2013\/06\/30\/implementing-a-custom-jsf-2-0-component-with-maven\/\">Implementing a custom JSF 2.0 component with maven<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Martin Mois at the <a href=\"http:\/\/martinsdeveloperworld.wordpress.com\/\">Martin&#8217;s Developer World<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Some time ago, I have written my own custom JSF component. But at that point in time, JSF 1.0 was still up to date and the project didn\u2019t use maven as build system. Thus, I always wanted to write a custom JSF2 component with maven. So let\u2019s start: First of all we setup a maven &hellip;<\/p>\n","protected":false},"author":506,"featured_media":73,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[68,293],"class_list":["post-18692","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-maven","tag-jsf"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Implementing a custom JSF 2.0 component with maven<\/title>\n<meta name=\"description\" content=\"Some time ago, I have written my own custom JSF component. But at that point in time, JSF 1.0 was still up to date and the project didn\u2019t use maven as\" \/>\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\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Implementing a custom JSF 2.0 component with maven\" \/>\n<meta property=\"og:description\" content=\"Some time ago, I have written my own custom JSF component. But at that point in time, JSF 1.0 was still up to date and the project didn\u2019t use maven as\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.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=\"2013-11-05T23:00:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-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=\"Martin Mois\" \/>\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=\"Martin Mois\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.html\"},\"author\":{\"name\":\"Martin Mois\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/52c1e27ea19337c20d53df5286590760\"},\"headline\":\"Implementing a custom JSF 2.0 component with maven\",\"datePublished\":\"2013-11-05T23:00:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.html\"},\"wordCount\":552,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"keywords\":[\"Apache Maven\",\"JSF\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.html\",\"name\":\"Implementing a custom JSF 2.0 component with maven\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"datePublished\":\"2013-11-05T23:00:14+00:00\",\"description\":\"Some time ago, I have written my own custom JSF component. But at that point in time, JSF 1.0 was still up to date and the project didn\u2019t use maven as\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2013\\\/11\\\/implementing-a-custom-jsf-2-0-component-with-maven.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\":\"Implementing a custom JSF 2.0 component with maven\"}]},{\"@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\\\/52c1e27ea19337c20d53df5286590760\",\"name\":\"Martin Mois\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/051a80ba18f758940b686c6c4bb4b5f02d59abe8cc42a95b3545f7565c7a40a1?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/051a80ba18f758940b686c6c4bb4b5f02d59abe8cc42a95b3545f7565c7a40a1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/051a80ba18f758940b686c6c4bb4b5f02d59abe8cc42a95b3545f7565c7a40a1?s=96&d=mm&r=g\",\"caption\":\"Martin Mois\"},\"description\":\"Martin is a Java EE enthusiast and works for an international operating company. He is interested in clean code and the software craftsmanship approach. He also strongly believes in automated testing and continuous integration.\",\"sameAs\":[\"http:\\\/\\\/martinsdeveloperworld.wordpress.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/martin-mois\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Implementing a custom JSF 2.0 component with maven","description":"Some time ago, I have written my own custom JSF component. But at that point in time, JSF 1.0 was still up to date and the project didn\u2019t use maven as","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\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html","og_locale":"en_US","og_type":"article","og_title":"Implementing a custom JSF 2.0 component with maven","og_description":"Some time ago, I have written my own custom JSF component. But at that point in time, JSF 1.0 was still up to date and the project didn\u2019t use maven as","og_url":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2013-11-05T23:00:14+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","type":"image\/jpeg"}],"author":"Martin Mois","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Martin Mois","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html"},"author":{"name":"Martin Mois","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/52c1e27ea19337c20d53df5286590760"},"headline":"Implementing a custom JSF 2.0 component with maven","datePublished":"2013-11-05T23:00:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html"},"wordCount":552,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","keywords":["Apache Maven","JSF"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html","url":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html","name":"Implementing a custom JSF 2.0 component with maven","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","datePublished":"2013-11-05T23:00:14+00:00","description":"Some time ago, I have written my own custom JSF component. But at that point in time, JSF 1.0 was still up to date and the project didn\u2019t use maven as","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2013\/11\/implementing-a-custom-jsf-2-0-component-with-maven.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":"Implementing a custom JSF 2.0 component with maven"}]},{"@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\/52c1e27ea19337c20d53df5286590760","name":"Martin Mois","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/051a80ba18f758940b686c6c4bb4b5f02d59abe8cc42a95b3545f7565c7a40a1?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/051a80ba18f758940b686c6c4bb4b5f02d59abe8cc42a95b3545f7565c7a40a1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/051a80ba18f758940b686c6c4bb4b5f02d59abe8cc42a95b3545f7565c7a40a1?s=96&d=mm&r=g","caption":"Martin Mois"},"description":"Martin is a Java EE enthusiast and works for an international operating company. He is interested in clean code and the software craftsmanship approach. He also strongly believes in automated testing and continuous integration.","sameAs":["http:\/\/martinsdeveloperworld.wordpress.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/martin-mois"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/18692","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\/506"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=18692"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/18692\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/73"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=18692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=18692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=18692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}