SlideShare una empresa de Scribd logo
1 de 25
1



 The author has made every effort in the preparation of this book to ensure the accuracy of the information.
However, information in this book is sold without warranty either expressed or implied. The author will not be
    held liable for any damages caused or alleged to be caused either directly or indirectly by this book.




         JSF, Facelets, Spring-JSF & Maven
 Facelets is a powerful templating language built from ground up for JSF.
 Facelets allow for greater code reuse than JSPs. This tutorial provides an
  example of how to work with JSF, Facelets and Spring-JSF along with
                            Maven-2 in Eclipse.




                                                    by




                                        K. Arulkumaran


                                           & A. Sivayini




               Website: http://www.lulu.com/java-success


             Feedback email: java-interview@hotmail.com
2

                                                 Table Of Contents


Notations ..................................................................................................................... 3
Tutorial 7 – JSF, Facelets, Maven & Eclipse...................................................... 4
Tutorial 8 – JSF, Facelets, Spring, Maven & Eclipse..................................... 19
3
                                     Notations

Command prompt:




Eclipse:




File Explorer or Windows Explorer:




Internet Explorer:
4
Tutorial 7 – JSF, Facelets, Maven & Eclipse


This tutorial will guide you through re-building tutorial-3 for simpleWeb with
facelets. It assumes that you have read tutorials 1-3.

The 3rd party library jar files required are:

                  <!-- JSF/JSTL/Facelets -->
                  <dependency>
                        <groupId>javax.faces</groupId>
                        <artifactId>jsf-api</artifactId>
                        <version>1.2</version>
                  </dependency>
                  <dependency>
                        <groupId>javax.faces</groupId>
                        <artifactId>jsf-impl</artifactId>
                        <version>1.2_04</version>
                  </dependency>
                  <dependency>
                        <groupId>com.sun.facelets</groupId>
                        <artifactId>jsf-facelets</artifactId>
                        <version>1.1.11</version>
                  </dependency>
                  <dependency>
                        <groupId>javax.servlet</groupId>
                        <artifactId>jstl</artifactId>
                        <version>1.1.2</version>
                  </dependency>
                  <dependency>
                        <groupId>javax.el</groupId>         Provided means used for
                        <artifactId>el-api</artifactId>     compiling but no need to
                        <version>1.0</version>              package it. This is because
                        <scope>provided</scope>             the Tomcat server has this
                  </dependency>                             package under its lib folder
                  <dependency>
                        <groupId>com.sun.el</groupId>
                        <artifactId>el-ri</artifactId>
                        <version>1.0</version>
                  </dependency>


Artifact el-ri (Expression Language – reference implementation) can be downloaded from the
following repository and all the other jars except jsf-impl (Sun JSF RI ) should be available from the
maven-2 default repository http://repo1.maven.org/maven2/.

         <repositories>
               <repository>
                     <id>maven-repository.dev.java.net</id>
                     <name>Java Dev Net Repository</name>
                     <url>http://download.java.net/maven/2/</url>
                     <releases>
                           <enabled>true</enabled>
                           <updatePolicy>never</updatePolicy>
                     </releases>
                     <snapshots>
                           <enabled>false</enabled>
                     </snapshots>
               </repository>
         </repositories>
5
Step1: Download JSF 1.2_04 P02 from the site https://javaserverfaces.dev.java.net/download.html
into say your download directory. Create a new folder maven_lib under your c:java folder for the
special library files which you can’t download from any maven repositories. Copy the jsf-impl.jar to
your “c:javamaven_lib” folder and rename it to “jsf-impl-1.2_04.jar”.




Now you need to install this JSF implementation jar into your local maven repository in
c:java.m2repository. To do this run the following command in a command prompt:

mvn install:install-file -Dfile=jsf-impl-1.2_04.jar -DgroupId=javax.faces -DartifactId=jsf-impl -
Dversion=1.2_04 -Dpackaging=jar -DgeneratePom=true




After running the above command, you can check for the presence of the jsf-impl-1.2_04.jar file in
your local maven 2 repository “c:java.m2repositoryjavax”.
6




Now the revised pom.xml file under c:tutorialssimpleWeb should look like:

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-
         v4_0_0.xsd">

        <modelVersion>4.0.0</modelVersion>
        <groupId>com.mytutorial</groupId>
        <artifactId>simpleWeb</artifactId>
        <packaging>war</packaging>
        <version>1.0-SNAPSHOT</version>
        <name>simpleWeb Maven Webapp</name>
        <url>http://maven.apache.org</url>
        <dependencies>
                  <dependency>
                          <groupId>junit</groupId>
                          <artifactId>junit</artifactId>
                          <version>3.8.1</version>
                          <scope>test</scope>
                  </dependency>

                 <dependency>
                         <groupId>commons-digester</groupId>
                         <artifactId>commons-digester</artifactId>
                         <version>1.8</version>
                 </dependency>

                 <dependency>
                         <groupId>commons-collections</groupId>
                         <artifactId>commons-collections</artifactId>
                         <version>3.2</version>
                 </dependency>
7
        <!-- JSF/JSTL/Facelets -->
        <dependency>
                <groupId>javax.faces</groupId>
                <artifactId>jsf-api</artifactId>
                <version>1.2</version>
        </dependency>
        <dependency>
                <groupId>javax.faces</groupId>
                <artifactId>jsf-impl</artifactId>
                <version>1.2_04</version>
        </dependency>
        <dependency>
                <groupId>com.sun.facelets</groupId>
                <artifactId>jsf-facelets</artifactId>
                <version>1.1.11</version>
        </dependency>
        <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>jstl</artifactId>
                <version>1.1.2</version>
        </dependency>
        <dependency>
                <groupId>javax.el</groupId>
                <artifactId>el-api</artifactId>
                <version>1.0</version>
                <scope>provided</scope>
        </dependency>
        <dependency>
                <groupId>com.sun.el</groupId>
                <artifactId>el-ri</artifactId>
                <version>1.0</version>
        </dependency>

</dependencies>

<build>
  <finalName>simpleWeb</finalName>
  <pluginManagement>
     <plugins>
         <plugin>                                               Java compiler
             <groupId>org.apache.maven.plugins</groupId>        JDK 1.5
             <artifactId>maven-compiler-plugin</artifactId>
             <version>2.0.2</version>
                   <configuration>
                      <source>1.5</source>
                     <target>1.5</target>
                   </configuration>
           </plugin>
           <plugin>                                           Using WTP 2.4 but
             <groupId>org.apache.maven.plugins</groupId>      JSF 1.2 requires 2.5,
             <artifactId>maven-eclipse-plugin</artifactId>    which is not yet
             <version>2.4</version>                           available. So refer
             <configuration>                                  Step: WorkAround
                   <downloadSources>false</downloadSources>   to manually change
                   <wtpversion>1.5</wtpversion>               this value.
               </configuration>
           </plugin>
          </plugins>
         </pluginManagement>
</build>

<repositories>
         <repository>
8
                           <id>maven-repository.dev.java.net</id>
                           <name>Java Dev Net Repository</name>
                           <url>http://download.java.net/maven/2/</url>
                           <releases>
                                    <enabled>true</enabled>
                                    <updatePolicy>never</updatePolicy>
                           </releases>
                           <snapshots>                           By default maven uses
                                    <enabled>false</enabled>     http://repo1.maven.org/maven2/
                           </snapshots>                          and your local repository in
                  </repository>                                  c:java.m2repository. Any other
         </repositories>                                         repositories need to be defined in
                                                                 the pom.xml file. el-i-1.0.jar can
</project>                                                       be found at this repository.

Note: if a particular jar file is not available in any repositories,
it can be downloaded separately and installed in to your local
repository c:java.m2repository using “mvn install:install-file …” as shown above.

Step-2: If you are already inside eclipse, exit out of it and run the following maven command from
c:tutorialssimpleWeb to generate eclipse build path (i.e. classpath).




STEP: WorkAround

The JSF 1.2 requires eclipse web facet 2.5. You need to open the file
“org.eclipse.wst.common.project.facet.core.xml” under C:tutorialssimpleWeb.settings as shown
below from version=2.4 to version=2.5. Every time you use the eclipse:clean command, you will have
to manually fix this up as shown below.




Step-3: Now get back into eclipse and click “F5” for refresh on the “simpleWeb” project. The
required files need to be completed as shown below:
9




PersonBean.java (Model)

package com.mytutorial;

public class PersonBean {
      String personName;

       public String getPersonName() {
             return personName;
       }

       public void setPersonName(String personName) {
             this.personName = personName;
       }
}


PersonBeanController.java (Controller)


package com.mytutorial;

public class PersonControllerBean {

       PersonBean person = new PersonBean(); //later on we will inject
                                             //this using spring

       public String getPersonName() {
             return person.getPersonName();
       }

       public void setPersonName(String personName) {
             person.setPersonName(personName);
       }

       public PersonBean getPerson() {
             return person;
       }
10

        public void setPerson(PersonBean person) {
              this.person = person;
        }

}


messages.properties (same as before in tutorial-3)

inputname_header=JSF Tutorial
prompt=Tell me your name:
greeting_text=Welcome to JSF
button_text=Hello
sign=!


greeting.jspx (page)

Note: The recommended extension for pages by facelets is the “.xhtml”. Since eclipse does not
recognize this and would not provide you code assist when you press ctrl-Space. So the work around is
to use the extension .jspx to solve this problem. These .jspx files can be opened using the webpage
editor provided by eclipse 3.3 WTP. To open the greeting.jspx in a webpage editor right click on it and
select “other” and then “WebPage Editor”
11




The completed “greeting.jspx” should look like:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets" version="2.0">

         <ui:composition>
           <html>
               <head>
                  <title>greeting page</title>
               </head>
               <body>
                   <f:loadBundle basename="com.mytutorial.messages" var="msg" />
                     <h3
                         <h:outputText value="#{msg.greeting_text}" />, <h:outputText
                                    value="#{personBean.personName}" />
                         <h:outputText value="#{msg.sign}" />
                     </h3>                                                   Defined in faces-
                                                                             config.xml
                </body>
             </html>
           </ui:composition>
</jsp:root>
12




inputname.jspx

<?xml version="1.0" encoding="ISO-8859-1" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets" version="2.0">

        <ui:composition>
          <html>
              <head>
                <meta http-equiv="Content-Type"
                         content="text/html; charset=ISO-8859-1" />
                 <title>Insert title here</title>
               </head>
               <body>
                <f:view>
                    <f:loadBundle basename="com.mytutorial.messages" var="msg" />
                        <h3>
                          <h:form id="helloForm">
                             <h:outputText value="#{msg.prompt}" />
                             <h:inputText value="#{personBean.personName}" />

                                <h:commandButton action="greeting" value="#{msg.button_text}" />
                                <h:outputText></h:outputText>
                              </h:form>
                             </h3>
                      </f:view>
                     </body>
                   </html>
              </ui:composition>
</jsp:root>
13




faces-config.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE faces-config PUBLIC
  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
  "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

<faces-config>

        <navigation-rule>
                <from-view-id>/pages/inputname.jspx</from-view-id>
                <navigation-case>
                         <from-outcome>greeting</from-outcome>
                         <to-view-id>/pages/greeting.jspx</to-view-id>
                </navigation-case>
        </navigation-rule>
                                                         Used in JSF pages

        <managed-bean>
               <managed-bean-name>personBean</managed-bean-name>
               <managed-bean-class>
                       com.mytutorial.PersonControllerBean
               </managed-bean-class>
               <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>


        <application>
                 <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
        </application>

</faces-config>
14




web.xml

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
       <context-param>
               <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
               <param-value>server</param-value>
       </context-param>

          <context-param>
                  <param-name>javax.faces.CONFIG_FILES</param-name>
                  <param-value>/WEB-INF/faces-config.xml</param-value>
          </context-param>

          <context-param>
                  <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                  <param-value>.jspx</param-value>
          </context-param>

          <!-- Special Debug Output for Development -->
          <context-param>
                   <param-name>facelets.DEVELOPMENT</param-name>
                   <param-value>true</param-value>
          </context-param>

          <!-- Optional JSF-RI Parameters to Help Debug -->
          <context-param>
                   <param-name>com.sun.faces.validateXml</param-name>
                   <param-value>true</param-value>
          </context-param>
          <context-param>
                   <param-name>com.sun.faces.verifyObjects</param-name>
                   <param-value>true</param-value>
15
        </context-param>

        <!-- Faces Servlet -->
        <servlet>
                 <servlet-name>Faces Servlet</servlet-name>
                 <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                 <load-on-startup>1</load-on-startup>
        </servlet>

        <!-- Faces Servlet Mapping -->
        <servlet-mapping>
                 <servlet-name>Faces Servlet</servlet-name>
                 <url-pattern>*.jsf</url-pattern>
        </servlet-mapping>
</web-app>




Finally the “index.jspx”

<?xml version="1.0" encoding="ISO-8859-1" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core" version="2.0">

        <ui:composition>
              <html>
              <body>

                 <f:view>
                       <a href="pages/inputname.jsf">Click Me</a>
                       <br />
                 </f:view>
                 </body>
16
            </html>
      </ui:composition>
</jsp:root>




You can now try to build it and deploy it to tomcat as discussed in tutorial-3. Try deploying it from
both inside eclipse & outside. You can check your deployed war file from inside eclipse under
following folder (check if it is properly packaged):




Important!!
17
It is important to note that, if you are deploying to Tomcat inside eclipse, remember to exclude the jar
files which are already available under Tomcat’s lib directory. So you need to remove the el-api-
1.0.jar file from getting packaged. You could do this inside eclipse by right clicking on simpleWeb
and then selecting “properties”. Under J2EE module dependencies make sure that el-api-1.0.jar is
unticked. Only the ticked files make it to the WEB-INlib folder. If you build the war file outside
eclipse then maven pom.xml file will take care of this, since its scope is declared as “provided”.




The URL to use after you deploy/publish and start the Tomcat server:

http://localhost:8080/simpleWeb/index.jsf
18




Please feel free to email any errors to java-interview@hotmail.com. Also stay tuned at
    http://www.lulu.com/java-success for more tutorials and Java/J2EE interview
                                        resources.
19
Tutorial 8 – JSF, Facelets, Spring, Maven & Eclipse


This is the continuation of tutorial-7 for simpleWeb with Spring. It assumes
that you have read tutorials 1-3 and tutorial 7. You need to make use of
Spring with JSF:


Add spring.jar to the pom.xml file under c:tutorialssimpleWeb

<dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring</artifactId>
       <version>2.0.6</version>
</dependency>




After adding, save it and exit out of eclipse and run the following mvn (Maven) command
from the command line.


mvn eclipse:eclipse
20




STEP: WorkAround

The JSF 1.2 requires eclipse web facet 2.5. You need to open the file
“org.eclipse.wst.common.project.facet.core.xml” under C:tutorialssimpleWeb.settings as show
below from version=2.4 to version=2.5. Every time you use the eclipse:clean command, you will have
to manually fix this up as shown below.




You can now open eclipse and refresh (i.e. F5) simpleWeb project. After this if you check
your eclipse build path, it should look like below with spring-2.0.6.jar.
21




Also check your project facet to make sure that dynamic web module is 2.5. If not repeat step marked
“Work Around” above after exiting eclipse.



To use Spring make the following changes to the existing artifacts and also add the
“applicationContext.xml” file under WEB-INF.



PersonControllerBean.java

Note the comments in bold. Spring will inject this.

package com.mytutorial;

public class PersonControllerBean {

         PersonBean person; //removed instantiation.
                            //Spring will inject this using the setter.

         public String getPersonName() {
               return person.getPersonName();
         }

         public void setPersonName(String personName) {
               person.setPersonName(personName);
         }

         public PersonBean getPerson() {
               return person;
         }

         public void setPerson(PersonBean person) {
               this.person = person;
         }

}


Let’s add the applicationContext.xml file
22
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

        <bean id="person" class="com.mytutorial.PersonBean" />

        <bean id="personBean" class="com.mytutorial.PersonControllerBean" scope="session">
                <property name="person" ref="person" />
        </bean>

</beans>




Now make the required changes to the descriptor files web.xml & faces-config.xml.

faces.-config.xml
Remove the <managed-bean> declaration and add the <variable-resolver> under <application>.

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE faces-config PUBLIC
  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
  "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

<faces-config>

        <navigation-rule>
                <from-view-id>/pages/inputname.jspx</from-view-id>
                <navigation-case>
                         <from-outcome>greeting</from-outcome>
                         <to-view-id>/pages/greeting.jspx</to-view-id>
                </navigation-case>
        </navigation-rule>

        <!-- To be removed, Spring will take care of this
        <managed-bean>
23
               <managed-bean-name>personBean</managed-bean-name>
               <managed-bean-class>
                       com.mytutorial.PersonControllerBean
               </managed-bean-class>
               <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>

        -->
                                                         Added

        <application>
           <variable-resolver>
                org.springframework.web.jsf.DelegatingVariableResolver
            </variable-resolver>
            <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
        </application>

</faces-config>




Finally add listeners and context-param to the web.xml

web.xml:

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
          <context-param>
                  <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                  <param-value>server</param-value>
          </context-param>
          <context-param>
                  <param-name>javax.faces.CONFIG_FILES</param-name>
24
                <param-value>/WEB-INF/faces-config.xml</param-value>
        </context-param>
        <context-param>
                <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                <param-value>.jspx</param-value>
        </context-param>                                             Added
        <context-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>/WEB-INF/applicationContext.xml</param-value>
        </context-param>

        <!-- Special Debug Output for Development -->
        <context-param>
                 <param-name>facelets.DEVELOPMENT</param-name>
                 <param-value>true</param-value>
        </context-param>
        <!-- Optional JSF-RI Parameters to Help Debug -->
        <context-param>
                 <param-name>com.sun.faces.validateXml</param-name>
                 <param-value>true</param-value>
        </context-param>
        <context-param>
                 <param-name>com.sun.faces.verifyObjects</param-name>
                 <param-value>true</param-value>
        </context-param>

        <listener>
              <listener-class>
                     org.springframework.web.context.ContextLoaderListener
              </listener-class>
        </listener>
                                                                          Added
        <listener>
              <listener-class>
                    org.springframework.web.context.request.RequestContextListener
              </listener-class>
          </listener>

        <!-- Faces Servlet -->
        <servlet>
                 <servlet-name>Faces Servlet</servlet-name>
                 <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                 <load-on-startup>1</load-on-startup>
        </servlet>

        <!-- Faces Servlet Mapping -->
        <servlet-mapping>
                 <servlet-name>Faces Servlet</servlet-name>
                 <url-pattern>*.jsf</url-pattern>
        </servlet-mapping>
</web-app>
25




The URL to use after you deploy/publish and start the Tomcat server:

http://localhost:8080/simpleWeb/index.jsf


Run the application as before and you should see the same output.
This time with Spring’s dependency injection.




Please feel free to email any errors to java-interview@hotmail.com. Also stay tuned at
    http://www.lulu.com/java-success for more tutorials and Java/J2EE interview
                                        resources.

Más contenido relacionado

La actualidad más candente

Ajax, JSF, Facelets, Eclipse & Maven tutorials
Ajax, JSF, Facelets, Eclipse & Maven tutorialsAjax, JSF, Facelets, Eclipse & Maven tutorials
Ajax, JSF, Facelets, Eclipse & Maven tutorialsRaghavan Mohan
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGArun Gupta
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerArun Gupta
 
Enterprise Maven Repository BOF
Enterprise Maven Repository BOFEnterprise Maven Repository BOF
Enterprise Maven Repository BOFMax Andersen
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudCarlos Sanchez
 
Hibernate, Spring, Eclipse, HSQL Database & Maven tutorial
Hibernate, Spring, Eclipse, HSQL Database & Maven tutorialHibernate, Spring, Eclipse, HSQL Database & Maven tutorial
Hibernate, Spring, Eclipse, HSQL Database & Maven tutorialRaghavan Mohan
 
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureJava EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureArun Gupta
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンharuki ueno
 
Java EE 6 & GlassFish v3: Paving path for the future
Java EE 6 & GlassFish v3: Paving path for the futureJava EE 6 & GlassFish v3: Paving path for the future
Java EE 6 & GlassFish v3: Paving path for the futureArun Gupta
 
Spring boot for buidling microservices
Spring boot for buidling microservicesSpring boot for buidling microservices
Spring boot for buidling microservicesNilanjan Roy
 
Simple module Development in Joomla! 2.5
Simple module Development in Joomla! 2.5Simple module Development in Joomla! 2.5
Simple module Development in Joomla! 2.5Vishwash Gaur
 
Maven, Eclipse And OSGi Working Together
Maven, Eclipse And OSGi Working TogetherMaven, Eclipse And OSGi Working Together
Maven, Eclipse And OSGi Working TogetherCarlos Sanchez
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudCarlos Sanchez
 
Spring boot入門ハンズオン第二回
Spring boot入門ハンズオン第二回Spring boot入門ハンズオン第二回
Spring boot入門ハンズオン第二回haruki ueno
 

La actualidad más candente (20)

Ajax, JSF, Facelets, Eclipse & Maven tutorials
Ajax, JSF, Facelets, Eclipse & Maven tutorialsAjax, JSF, Facelets, Eclipse & Maven tutorials
Ajax, JSF, Facelets, Eclipse & Maven tutorials
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
 
Releasing Projects Using Maven
Releasing Projects Using MavenReleasing Projects Using Maven
Releasing Projects Using Maven
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More Power
 
Enterprise Maven Repository BOF
Enterprise Maven Repository BOFEnterprise Maven Repository BOF
Enterprise Maven Repository BOF
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The Cloud
 
Google app engine by example
Google app engine by exampleGoogle app engine by example
Google app engine by example
 
Hibernate, Spring, Eclipse, HSQL Database & Maven tutorial
Hibernate, Spring, Eclipse, HSQL Database & Maven tutorialHibernate, Spring, Eclipse, HSQL Database & Maven tutorial
Hibernate, Spring, Eclipse, HSQL Database & Maven tutorial
 
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureJava EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for future
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオン
 
Java EE 6 & GlassFish v3: Paving path for the future
Java EE 6 & GlassFish v3: Paving path for the futureJava EE 6 & GlassFish v3: Paving path for the future
Java EE 6 & GlassFish v3: Paving path for the future
 
Spring boot for buidling microservices
Spring boot for buidling microservicesSpring boot for buidling microservices
Spring boot for buidling microservices
 
Algotitmo Moinho
Algotitmo MoinhoAlgotitmo Moinho
Algotitmo Moinho
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Simple module Development in Joomla! 2.5
Simple module Development in Joomla! 2.5Simple module Development in Joomla! 2.5
Simple module Development in Joomla! 2.5
 
Maven, Eclipse And OSGi Working Together
Maven, Eclipse And OSGi Working TogetherMaven, Eclipse And OSGi Working Together
Maven, Eclipse And OSGi Working Together
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The Cloud
 
Spring boot入門ハンズオン第二回
Spring boot入門ハンズオン第二回Spring boot入門ハンズオン第二回
Spring boot入門ハンズオン第二回
 
Install Samples
Install SamplesInstall Samples
Install Samples
 

Destacado

Introduction to Ext JS 4
Introduction to Ext JS 4Introduction to Ext JS 4
Introduction to Ext JS 4Stefan Gehrig
 
Medication Reconciliation in Electronic Health Information Exchange
Medication Reconciliation in Electronic Health Information ExchangeMedication Reconciliation in Electronic Health Information Exchange
Medication Reconciliation in Electronic Health Information ExchangeTomasz Adamusiak
 
Proceedings online v2
Proceedings online v2Proceedings online v2
Proceedings online v2Nick Sage
 
Attack_Simulation_and_Threat_Modeling
Attack_Simulation_and_Threat_ModelingAttack_Simulation_and_Threat_Modeling
Attack_Simulation_and_Threat_ModelingOluseyi Akindeinde
 
互联网搜索技巧
互联网搜索技巧互联网搜索技巧
互联网搜索技巧bemyfriend
 
Tomislav Capan - Muzika Hr (IT Showoff)
Tomislav Capan - Muzika Hr (IT Showoff)Tomislav Capan - Muzika Hr (IT Showoff)
Tomislav Capan - Muzika Hr (IT Showoff)IT Showoff
 
Adobe Digital Publishing Suite by dualpixel
Adobe Digital Publishing Suite by dualpixelAdobe Digital Publishing Suite by dualpixel
Adobe Digital Publishing Suite by dualpixeldualpixel
 
2011 New Product Showcase
2011 New Product Showcase2011 New Product Showcase
2011 New Product Showcasebmmitt
 
Web Application Hacking 2004
Web Application Hacking 2004Web Application Hacking 2004
Web Application Hacking 2004Mike Spaulding
 
Shanghai big tradeshow calendar 2014 collection by MARKYE@LIERJIA.CN
Shanghai big tradeshow calendar 2014 collection by MARKYE@LIERJIA.CN Shanghai big tradeshow calendar 2014 collection by MARKYE@LIERJIA.CN
Shanghai big tradeshow calendar 2014 collection by MARKYE@LIERJIA.CN YiMu Exhibition Services Co.,Ltd.
 

Destacado (20)

Introduction to Ext JS 4
Introduction to Ext JS 4Introduction to Ext JS 4
Introduction to Ext JS 4
 
Medication Reconciliation in Electronic Health Information Exchange
Medication Reconciliation in Electronic Health Information ExchangeMedication Reconciliation in Electronic Health Information Exchange
Medication Reconciliation in Electronic Health Information Exchange
 
Proceedings online v2
Proceedings online v2Proceedings online v2
Proceedings online v2
 
JSF2 and JSP
JSF2 and JSPJSF2 and JSP
JSF2 and JSP
 
document
documentdocument
document
 
Attack_Simulation_and_Threat_Modeling
Attack_Simulation_and_Threat_ModelingAttack_Simulation_and_Threat_Modeling
Attack_Simulation_and_Threat_Modeling
 
Search engines
Search enginesSearch engines
Search engines
 
Xakep
XakepXakep
Xakep
 
Google
GoogleGoogle
Google
 
互联网搜索技巧
互联网搜索技巧互联网搜索技巧
互联网搜索技巧
 
Tomislav Capan - Muzika Hr (IT Showoff)
Tomislav Capan - Muzika Hr (IT Showoff)Tomislav Capan - Muzika Hr (IT Showoff)
Tomislav Capan - Muzika Hr (IT Showoff)
 
IoF South West Conference
IoF South West ConferenceIoF South West Conference
IoF South West Conference
 
Adobe Digital Publishing Suite by dualpixel
Adobe Digital Publishing Suite by dualpixelAdobe Digital Publishing Suite by dualpixel
Adobe Digital Publishing Suite by dualpixel
 
2011 New Product Showcase
2011 New Product Showcase2011 New Product Showcase
2011 New Product Showcase
 
Web Application Hacking 2004
Web Application Hacking 2004Web Application Hacking 2004
Web Application Hacking 2004
 
Ticer2005
Ticer2005Ticer2005
Ticer2005
 
Training for Foster Parents
Training for Foster ParentsTraining for Foster Parents
Training for Foster Parents
 
Shanghai big tradeshow calendar 2014 collection by MARKYE@LIERJIA.CN
Shanghai big tradeshow calendar 2014 collection by MARKYE@LIERJIA.CN Shanghai big tradeshow calendar 2014 collection by MARKYE@LIERJIA.CN
Shanghai big tradeshow calendar 2014 collection by MARKYE@LIERJIA.CN
 
Unemployment
UnemploymentUnemployment
Unemployment
 
Catalog
CatalogCatalog
Catalog
 

Similar a JSF, Facelets, Spring-JSF & Maven

Pom configuration java xml
Pom configuration java xmlPom configuration java xml
Pom configuration java xmlakmini
 
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorialsSpring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorialsRaghavan Mohan
 
Make use of Sonar for your mobile developments - It's easy and useful!
Make use of Sonar for your mobile developments - It's easy and useful!Make use of Sonar for your mobile developments - It's easy and useful!
Make use of Sonar for your mobile developments - It's easy and useful!cyrilpicat
 
Soft shake 2013 - make use of sonar on your mobile developments
Soft shake 2013 - make use of sonar on your mobile developmentsSoft shake 2013 - make use of sonar on your mobile developments
Soft shake 2013 - make use of sonar on your mobile developmentsrfelden
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with MavenSid Anand
 
Introduction To Maven2
Introduction To Maven2Introduction To Maven2
Introduction To Maven2Shuji Watanabe
 
Gradle: From Extreme to Mainstream
Gradle: From Extreme to MainstreamGradle: From Extreme to Mainstream
Gradle: From Extreme to MainstreamBTI360
 
An Introduction to Maven and Flex
An Introduction to Maven and FlexAn Introduction to Maven and Flex
An Introduction to Maven and FlexJustin J. Moses
 
Apache Maven supports all Java (JokerConf 2018)
Apache Maven supports all Java (JokerConf 2018)Apache Maven supports all Java (JokerConf 2018)
Apache Maven supports all Java (JokerConf 2018)Robert Scholte
 
Note - Apache Maven Intro
Note - Apache Maven IntroNote - Apache Maven Intro
Note - Apache Maven Introboyw165
 
Spring Boot and JHipster
Spring Boot and JHipsterSpring Boot and JHipster
Spring Boot and JHipsterEueung Mulyana
 
Hibernate 5 – merge() Example
Hibernate 5 – merge() ExampleHibernate 5 – merge() Example
Hibernate 5 – merge() ExampleDucat India
 

Similar a JSF, Facelets, Spring-JSF & Maven (20)

Pom configuration java xml
Pom configuration java xmlPom configuration java xml
Pom configuration java xml
 
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorialsSpring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
 
Apache Maven basics
Apache Maven basicsApache Maven basics
Apache Maven basics
 
Make use of Sonar for your mobile developments - It's easy and useful!
Make use of Sonar for your mobile developments - It's easy and useful!Make use of Sonar for your mobile developments - It's easy and useful!
Make use of Sonar for your mobile developments - It's easy and useful!
 
Soft shake 2013 - make use of sonar on your mobile developments
Soft shake 2013 - make use of sonar on your mobile developmentsSoft shake 2013 - make use of sonar on your mobile developments
Soft shake 2013 - make use of sonar on your mobile developments
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
 
Introduction To Maven2
Introduction To Maven2Introduction To Maven2
Introduction To Maven2
 
Using Maven2
Using Maven2Using Maven2
Using Maven2
 
Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
 
Ant, Maven and Jenkins
Ant, Maven and JenkinsAnt, Maven and Jenkins
Ant, Maven and Jenkins
 
Gradle: From Extreme to Mainstream
Gradle: From Extreme to MainstreamGradle: From Extreme to Mainstream
Gradle: From Extreme to Mainstream
 
An Introduction to Maven and Flex
An Introduction to Maven and FlexAn Introduction to Maven and Flex
An Introduction to Maven and Flex
 
Pom
PomPom
Pom
 
Apache Maven supports all Java (JokerConf 2018)
Apache Maven supports all Java (JokerConf 2018)Apache Maven supports all Java (JokerConf 2018)
Apache Maven supports all Java (JokerConf 2018)
 
AOP sec3.pptx
AOP sec3.pptxAOP sec3.pptx
AOP sec3.pptx
 
Apache Maven for AT/QC
Apache Maven for AT/QCApache Maven for AT/QC
Apache Maven for AT/QC
 
Note - Apache Maven Intro
Note - Apache Maven IntroNote - Apache Maven Intro
Note - Apache Maven Intro
 
Spring Boot and JHipster
Spring Boot and JHipsterSpring Boot and JHipster
Spring Boot and JHipster
 
Hibernate 5 – merge() Example
Hibernate 5 – merge() ExampleHibernate 5 – merge() Example
Hibernate 5 – merge() Example
 
Sel study notes
Sel study notesSel study notes
Sel study notes
 

Más de Raghavan Mohan

Accelerate with BIRT and Actuate11
Accelerate with BIRT and Actuate11Accelerate with BIRT and Actuate11
Accelerate with BIRT and Actuate11Raghavan Mohan
 
Sachin Tendulkar Resume
Sachin Tendulkar ResumeSachin Tendulkar Resume
Sachin Tendulkar ResumeRaghavan Mohan
 
Senator Barrack Obama Resume
Senator Barrack Obama ResumeSenator Barrack Obama Resume
Senator Barrack Obama ResumeRaghavan Mohan
 
23617968 digit-fast-track-jan-2009-php
23617968 digit-fast-track-jan-2009-php23617968 digit-fast-track-jan-2009-php
23617968 digit-fast-track-jan-2009-phpRaghavan Mohan
 
Quality - Douglas Crockford
Quality - Douglas CrockfordQuality - Douglas Crockford
Quality - Douglas CrockfordRaghavan Mohan
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming LanguageRaghavan Mohan
 

Más de Raghavan Mohan (12)

Accelerate with BIRT and Actuate11
Accelerate with BIRT and Actuate11Accelerate with BIRT and Actuate11
Accelerate with BIRT and Actuate11
 
Who is BIRT
Who is BIRTWho is BIRT
Who is BIRT
 
Introduction to BIRT
Introduction to BIRTIntroduction to BIRT
Introduction to BIRT
 
Sachin Tendulkar Resume
Sachin Tendulkar ResumeSachin Tendulkar Resume
Sachin Tendulkar Resume
 
Manmohan Singh Resume
Manmohan Singh ResumeManmohan Singh Resume
Manmohan Singh Resume
 
Senator Barrack Obama Resume
Senator Barrack Obama ResumeSenator Barrack Obama Resume
Senator Barrack Obama Resume
 
Java/J2EE CV Guide
Java/J2EE CV GuideJava/J2EE CV Guide
Java/J2EE CV Guide
 
Java/J2EE Companion
Java/J2EE CompanionJava/J2EE Companion
Java/J2EE Companion
 
Fast Track to Ajax.
Fast Track to Ajax.Fast Track to Ajax.
Fast Track to Ajax.
 
23617968 digit-fast-track-jan-2009-php
23617968 digit-fast-track-jan-2009-php23617968 digit-fast-track-jan-2009-php
23617968 digit-fast-track-jan-2009-php
 
Quality - Douglas Crockford
Quality - Douglas CrockfordQuality - Douglas Crockford
Quality - Douglas Crockford
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
 

Último

The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Top 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTop 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTopCSSGallery
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Libraryshyamraj55
 
Keep Your Finger on the Pulse of Your Building's Performance with IES Live
Keep Your Finger on the Pulse of Your Building's Performance with IES LiveKeep Your Finger on the Pulse of Your Building's Performance with IES Live
Keep Your Finger on the Pulse of Your Building's Performance with IES LiveIES VE
 
Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...DianaGray10
 
LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0DanBrown980551
 
AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024Brian Pichman
 
Patch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updatePatch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updateadam112203
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTxtailishbaloch
 
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInOutage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInThousandEyes
 
3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud DataEric D. Schabell
 
Planetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl
 
Flow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameFlow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameKapil Thakar
 
Introduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationIntroduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationKnoldus Inc.
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)IES VE
 
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch TuesdayIvanti
 
Graphene Quantum Dots-Based Composites for Biomedical Applications
Graphene Quantum Dots-Based Composites for  Biomedical ApplicationsGraphene Quantum Dots-Based Composites for  Biomedical Applications
Graphene Quantum Dots-Based Composites for Biomedical Applicationsnooralam814309
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox
 
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNovo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNeo4j
 

Último (20)

The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Top 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTop 10 Squarespace Development Companies
Top 10 Squarespace Development Companies
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Library
 
Keep Your Finger on the Pulse of Your Building's Performance with IES Live
Keep Your Finger on the Pulse of Your Building's Performance with IES LiveKeep Your Finger on the Pulse of Your Building's Performance with IES Live
Keep Your Finger on the Pulse of Your Building's Performance with IES Live
 
Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...
 
LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0
 
AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024AI Workshops at Computers In Libraries 2024
AI Workshops at Computers In Libraries 2024
 
Patch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 updatePatch notes explaining DISARM Version 1.4 update
Patch notes explaining DISARM Version 1.4 update
 
SheDev 2024
SheDev 2024SheDev 2024
SheDev 2024
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
 
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInOutage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
 
3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data3 Pitfalls Everyone Should Avoid with Cloud Data
3 Pitfalls Everyone Should Avoid with Cloud Data
 
Planetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile Brochure
 
Flow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameFlow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First Frame
 
Introduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its applicationIntroduction to RAG (Retrieval Augmented Generation) and its application
Introduction to RAG (Retrieval Augmented Generation) and its application
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)
 
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch Tuesday
 
Graphene Quantum Dots-Based Composites for Biomedical Applications
Graphene Quantum Dots-Based Composites for  Biomedical ApplicationsGraphene Quantum Dots-Based Composites for  Biomedical Applications
Graphene Quantum Dots-Based Composites for Biomedical Applications
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
 
Novo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4jNovo Nordisk's journey in developing an open-source application on Neo4j
Novo Nordisk's journey in developing an open-source application on Neo4j
 

JSF, Facelets, Spring-JSF & Maven

  • 1. 1 The author has made every effort in the preparation of this book to ensure the accuracy of the information. However, information in this book is sold without warranty either expressed or implied. The author will not be held liable for any damages caused or alleged to be caused either directly or indirectly by this book. JSF, Facelets, Spring-JSF & Maven Facelets is a powerful templating language built from ground up for JSF. Facelets allow for greater code reuse than JSPs. This tutorial provides an example of how to work with JSF, Facelets and Spring-JSF along with Maven-2 in Eclipse. by K. Arulkumaran & A. Sivayini Website: http://www.lulu.com/java-success Feedback email: java-interview@hotmail.com
  • 2. 2 Table Of Contents Notations ..................................................................................................................... 3 Tutorial 7 – JSF, Facelets, Maven & Eclipse...................................................... 4 Tutorial 8 – JSF, Facelets, Spring, Maven & Eclipse..................................... 19
  • 3. 3 Notations Command prompt: Eclipse: File Explorer or Windows Explorer: Internet Explorer:
  • 4. 4 Tutorial 7 – JSF, Facelets, Maven & Eclipse This tutorial will guide you through re-building tutorial-3 for simpleWeb with facelets. It assumes that you have read tutorials 1-3. The 3rd party library jar files required are: <!-- JSF/JSTL/Facelets --> <dependency> <groupId>javax.faces</groupId> <artifactId>jsf-api</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>javax.faces</groupId> <artifactId>jsf-impl</artifactId> <version>1.2_04</version> </dependency> <dependency> <groupId>com.sun.facelets</groupId> <artifactId>jsf-facelets</artifactId> <version>1.1.11</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>javax.el</groupId> Provided means used for <artifactId>el-api</artifactId> compiling but no need to <version>1.0</version> package it. This is because <scope>provided</scope> the Tomcat server has this </dependency> package under its lib folder <dependency> <groupId>com.sun.el</groupId> <artifactId>el-ri</artifactId> <version>1.0</version> </dependency> Artifact el-ri (Expression Language – reference implementation) can be downloaded from the following repository and all the other jars except jsf-impl (Sun JSF RI ) should be available from the maven-2 default repository http://repo1.maven.org/maven2/. <repositories> <repository> <id>maven-repository.dev.java.net</id> <name>Java Dev Net Repository</name> <url>http://download.java.net/maven/2/</url> <releases> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories>
  • 5. 5 Step1: Download JSF 1.2_04 P02 from the site https://javaserverfaces.dev.java.net/download.html into say your download directory. Create a new folder maven_lib under your c:java folder for the special library files which you can’t download from any maven repositories. Copy the jsf-impl.jar to your “c:javamaven_lib” folder and rename it to “jsf-impl-1.2_04.jar”. Now you need to install this JSF implementation jar into your local maven repository in c:java.m2repository. To do this run the following command in a command prompt: mvn install:install-file -Dfile=jsf-impl-1.2_04.jar -DgroupId=javax.faces -DartifactId=jsf-impl - Dversion=1.2_04 -Dpackaging=jar -DgeneratePom=true After running the above command, you can check for the presence of the jsf-impl-1.2_04.jar file in your local maven 2 repository “c:java.m2repositoryjavax”.
  • 6. 6 Now the revised pom.xml file under c:tutorialssimpleWeb should look like: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven- v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.mytutorial</groupId> <artifactId>simpleWeb</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>simpleWeb Maven Webapp</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>commons-digester</groupId> <artifactId>commons-digester</artifactId> <version>1.8</version> </dependency> <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.2</version> </dependency>
  • 7. 7 <!-- JSF/JSTL/Facelets --> <dependency> <groupId>javax.faces</groupId> <artifactId>jsf-api</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>javax.faces</groupId> <artifactId>jsf-impl</artifactId> <version>1.2_04</version> </dependency> <dependency> <groupId>com.sun.facelets</groupId> <artifactId>jsf-facelets</artifactId> <version>1.1.11</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>javax.el</groupId> <artifactId>el-api</artifactId> <version>1.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.sun.el</groupId> <artifactId>el-ri</artifactId> <version>1.0</version> </dependency> </dependencies> <build> <finalName>simpleWeb</finalName> <pluginManagement> <plugins> <plugin> Java compiler <groupId>org.apache.maven.plugins</groupId> JDK 1.5 <artifactId>maven-compiler-plugin</artifactId> <version>2.0.2</version> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> <plugin> Using WTP 2.4 but <groupId>org.apache.maven.plugins</groupId> JSF 1.2 requires 2.5, <artifactId>maven-eclipse-plugin</artifactId> which is not yet <version>2.4</version> available. So refer <configuration> Step: WorkAround <downloadSources>false</downloadSources> to manually change <wtpversion>1.5</wtpversion> this value. </configuration> </plugin> </plugins> </pluginManagement> </build> <repositories> <repository>
  • 8. 8 <id>maven-repository.dev.java.net</id> <name>Java Dev Net Repository</name> <url>http://download.java.net/maven/2/</url> <releases> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> By default maven uses <enabled>false</enabled> http://repo1.maven.org/maven2/ </snapshots> and your local repository in </repository> c:java.m2repository. Any other </repositories> repositories need to be defined in the pom.xml file. el-i-1.0.jar can </project> be found at this repository. Note: if a particular jar file is not available in any repositories, it can be downloaded separately and installed in to your local repository c:java.m2repository using “mvn install:install-file …” as shown above. Step-2: If you are already inside eclipse, exit out of it and run the following maven command from c:tutorialssimpleWeb to generate eclipse build path (i.e. classpath). STEP: WorkAround The JSF 1.2 requires eclipse web facet 2.5. You need to open the file “org.eclipse.wst.common.project.facet.core.xml” under C:tutorialssimpleWeb.settings as shown below from version=2.4 to version=2.5. Every time you use the eclipse:clean command, you will have to manually fix this up as shown below. Step-3: Now get back into eclipse and click “F5” for refresh on the “simpleWeb” project. The required files need to be completed as shown below:
  • 9. 9 PersonBean.java (Model) package com.mytutorial; public class PersonBean { String personName; public String getPersonName() { return personName; } public void setPersonName(String personName) { this.personName = personName; } } PersonBeanController.java (Controller) package com.mytutorial; public class PersonControllerBean { PersonBean person = new PersonBean(); //later on we will inject //this using spring public String getPersonName() { return person.getPersonName(); } public void setPersonName(String personName) { person.setPersonName(personName); } public PersonBean getPerson() { return person; }
  • 10. 10 public void setPerson(PersonBean person) { this.person = person; } } messages.properties (same as before in tutorial-3) inputname_header=JSF Tutorial prompt=Tell me your name: greeting_text=Welcome to JSF button_text=Hello sign=! greeting.jspx (page) Note: The recommended extension for pages by facelets is the “.xhtml”. Since eclipse does not recognize this and would not provide you code assist when you press ctrl-Space. So the work around is to use the extension .jspx to solve this problem. These .jspx files can be opened using the webpage editor provided by eclipse 3.3 WTP. To open the greeting.jspx in a webpage editor right click on it and select “other” and then “WebPage Editor”
  • 11. 11 The completed “greeting.jspx” should look like: <?xml version="1.0" encoding="ISO-8859-1" ?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" version="2.0"> <ui:composition> <html> <head> <title>greeting page</title> </head> <body> <f:loadBundle basename="com.mytutorial.messages" var="msg" /> <h3 <h:outputText value="#{msg.greeting_text}" />, <h:outputText value="#{personBean.personName}" /> <h:outputText value="#{msg.sign}" /> </h3> Defined in faces- config.xml </body> </html> </ui:composition> </jsp:root>
  • 12. 12 inputname.jspx <?xml version="1.0" encoding="ISO-8859-1" ?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" version="2.0"> <ui:composition> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Insert title here</title> </head> <body> <f:view> <f:loadBundle basename="com.mytutorial.messages" var="msg" /> <h3> <h:form id="helloForm"> <h:outputText value="#{msg.prompt}" /> <h:inputText value="#{personBean.personName}" /> <h:commandButton action="greeting" value="#{msg.button_text}" /> <h:outputText></h:outputText> </h:form> </h3> </f:view> </body> </html> </ui:composition> </jsp:root>
  • 13. 13 faces-config.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> <faces-config> <navigation-rule> <from-view-id>/pages/inputname.jspx</from-view-id> <navigation-case> <from-outcome>greeting</from-outcome> <to-view-id>/pages/greeting.jspx</to-view-id> </navigation-case> </navigation-rule> Used in JSF pages <managed-bean> <managed-bean-name>personBean</managed-bean-name> <managed-bean-class> com.mytutorial.PersonControllerBean </managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> <application> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> </application> </faces-config>
  • 14. 14 web.xml <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>server</param-value> </context-param> <context-param> <param-name>javax.faces.CONFIG_FILES</param-name> <param-value>/WEB-INF/faces-config.xml</param-value> </context-param> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.jspx</param-value> </context-param> <!-- Special Debug Output for Development --> <context-param> <param-name>facelets.DEVELOPMENT</param-name> <param-value>true</param-value> </context-param> <!-- Optional JSF-RI Parameters to Help Debug --> <context-param> <param-name>com.sun.faces.validateXml</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>com.sun.faces.verifyObjects</param-name> <param-value>true</param-value>
  • 15. 15 </context-param> <!-- Faces Servlet --> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- Faces Servlet Mapping --> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> </web-app> Finally the “index.jspx” <?xml version="1.0" encoding="ISO-8859-1" ?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" version="2.0"> <ui:composition> <html> <body> <f:view> <a href="pages/inputname.jsf">Click Me</a> <br /> </f:view> </body>
  • 16. 16 </html> </ui:composition> </jsp:root> You can now try to build it and deploy it to tomcat as discussed in tutorial-3. Try deploying it from both inside eclipse & outside. You can check your deployed war file from inside eclipse under following folder (check if it is properly packaged): Important!!
  • 17. 17 It is important to note that, if you are deploying to Tomcat inside eclipse, remember to exclude the jar files which are already available under Tomcat’s lib directory. So you need to remove the el-api- 1.0.jar file from getting packaged. You could do this inside eclipse by right clicking on simpleWeb and then selecting “properties”. Under J2EE module dependencies make sure that el-api-1.0.jar is unticked. Only the ticked files make it to the WEB-INlib folder. If you build the war file outside eclipse then maven pom.xml file will take care of this, since its scope is declared as “provided”. The URL to use after you deploy/publish and start the Tomcat server: http://localhost:8080/simpleWeb/index.jsf
  • 18. 18 Please feel free to email any errors to java-interview@hotmail.com. Also stay tuned at http://www.lulu.com/java-success for more tutorials and Java/J2EE interview resources.
  • 19. 19 Tutorial 8 – JSF, Facelets, Spring, Maven & Eclipse This is the continuation of tutorial-7 for simpleWeb with Spring. It assumes that you have read tutorials 1-3 and tutorial 7. You need to make use of Spring with JSF: Add spring.jar to the pom.xml file under c:tutorialssimpleWeb <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.0.6</version> </dependency> After adding, save it and exit out of eclipse and run the following mvn (Maven) command from the command line. mvn eclipse:eclipse
  • 20. 20 STEP: WorkAround The JSF 1.2 requires eclipse web facet 2.5. You need to open the file “org.eclipse.wst.common.project.facet.core.xml” under C:tutorialssimpleWeb.settings as show below from version=2.4 to version=2.5. Every time you use the eclipse:clean command, you will have to manually fix this up as shown below. You can now open eclipse and refresh (i.e. F5) simpleWeb project. After this if you check your eclipse build path, it should look like below with spring-2.0.6.jar.
  • 21. 21 Also check your project facet to make sure that dynamic web module is 2.5. If not repeat step marked “Work Around” above after exiting eclipse. To use Spring make the following changes to the existing artifacts and also add the “applicationContext.xml” file under WEB-INF. PersonControllerBean.java Note the comments in bold. Spring will inject this. package com.mytutorial; public class PersonControllerBean { PersonBean person; //removed instantiation. //Spring will inject this using the setter. public String getPersonName() { return person.getPersonName(); } public void setPersonName(String personName) { person.setPersonName(personName); } public PersonBean getPerson() { return person; } public void setPerson(PersonBean person) { this.person = person; } } Let’s add the applicationContext.xml file
  • 22. 22 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> <bean id="person" class="com.mytutorial.PersonBean" /> <bean id="personBean" class="com.mytutorial.PersonControllerBean" scope="session"> <property name="person" ref="person" /> </bean> </beans> Now make the required changes to the descriptor files web.xml & faces-config.xml. faces.-config.xml Remove the <managed-bean> declaration and add the <variable-resolver> under <application>. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> <faces-config> <navigation-rule> <from-view-id>/pages/inputname.jspx</from-view-id> <navigation-case> <from-outcome>greeting</from-outcome> <to-view-id>/pages/greeting.jspx</to-view-id> </navigation-case> </navigation-rule> <!-- To be removed, Spring will take care of this <managed-bean>
  • 23. 23 <managed-bean-name>personBean</managed-bean-name> <managed-bean-class> com.mytutorial.PersonControllerBean </managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> --> Added <application> <variable-resolver> org.springframework.web.jsf.DelegatingVariableResolver </variable-resolver> <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> </application> </faces-config> Finally add listeners and context-param to the web.xml web.xml: <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>server</param-value> </context-param> <context-param> <param-name>javax.faces.CONFIG_FILES</param-name>
  • 24. 24 <param-value>/WEB-INF/faces-config.xml</param-value> </context-param> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.jspx</param-value> </context-param> Added <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <!-- Special Debug Output for Development --> <context-param> <param-name>facelets.DEVELOPMENT</param-name> <param-value>true</param-value> </context-param> <!-- Optional JSF-RI Parameters to Help Debug --> <context-param> <param-name>com.sun.faces.validateXml</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>com.sun.faces.verifyObjects</param-name> <param-value>true</param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> Added <listener> <listener-class> org.springframework.web.context.request.RequestContextListener </listener-class> </listener> <!-- Faces Servlet --> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- Faces Servlet Mapping --> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> </web-app>
  • 25. 25 The URL to use after you deploy/publish and start the Tomcat server: http://localhost:8080/simpleWeb/index.jsf Run the application as before and you should see the same output. This time with Spring’s dependency injection. Please feel free to email any errors to java-interview@hotmail.com. Also stay tuned at http://www.lulu.com/java-success for more tutorials and Java/J2EE interview resources.