0% found this document useful (0 votes)
88 views7 pages

Tutorial JSF

The document provides steps for setting up a JSF project in Maven including: 1. Creating a Maven project 2. Configuring dependencies for JSF, JPA, and other libraries 3. Running clean and build to compile the project files It also notes that key JSF files include web.xml, index files, controllers, DAOs, entities, and that source code packages are typically organized under Web-INF.

Uploaded by

Anggoro Sakti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views7 pages

Tutorial JSF

The document provides steps for setting up a JSF project in Maven including: 1. Creating a Maven project 2. Configuring dependencies for JSF, JPA, and other libraries 3. Running clean and build to compile the project files It also notes that key JSF files include web.xml, index files, controllers, DAOs, entities, and that source code packages are typically organized under Web-INF.

Uploaded by

Anggoro Sakti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

TUTORIAL JSF

1. Create project maven


2. Setting dependencies
<?xml version="1.0" encoding="UTF-8"?>

<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/xsd/maven-
4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>com.mutia</groupId>

<artifactId>BKT-Sadhana-Web</artifactId>

<version>1.0-SNAPSHOT</version>

<packaging>war</packaging>

<name>BKT-Sadhana-Web</name>

<properties>

<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

</properties>

<dependencies>

<dependency>

<groupId>javax.enterprise</groupId>

<artifactId>cdi-api</artifactId>

<version>1.2</version>

</dependency>

<dependency>

<groupId>org.hibernate</groupId>

<artifactId>hibernate-core</artifactId>

<version>3.6.10.Final</version>

</dependency>

<dependency>
<groupId>org.hibernate</groupId>

<artifactId>hibernate-entitymanager</artifactId>

<version>3.6.10.Final</version>

</dependency>

<dependency>

<groupId>org.hibernate</groupId>

<artifactId>hibernate-commons-annotations</artifactId>

<version>3.2.0.Final</version>

</dependency>

<dependency>

<groupId>javax.transaction</groupId>

<artifactId>jta</artifactId>

<version>1.1</version>

</dependency>

<dependency>

<groupId>javax.servlet</groupId>

<artifactId>jstl</artifactId>

<version>1.2</version>

</dependency>

<dependency>

<groupId>javax.servlet</groupId>

<artifactId>servlet-api</artifactId>

<version>2.5</version>

<scope>provided</scope>

</dependency>

<dependency>

<groupId>com.sun.jersey</groupId>

<artifactId>jersey-server</artifactId>

<version>1.17.1</version>
</dependency>

<dependency>

<groupId>com.sun.jersey</groupId>

<artifactId>jersey-core</artifactId>

<version>1.17.1</version>

</dependency>

<dependency>

<groupId>com.sun.jersey</groupId>

<artifactId>jersey-servlet</artifactId>

<version>1.17.1</version>

</dependency>

<dependency>

<groupId>com.sun.faces</groupId>

<artifactId>jsf-api</artifactId>

<version>2.2.20</version>

<scope>provided</scope>

</dependency>

<dependency>

<groupId>com.sun.faces</groupId>

<artifactId>jsf-impl</artifactId>

<version>2.1.7</version>

</dependency>

<dependency>

<groupId>javax.faces</groupId>

<artifactId>jsf-api</artifactId>

<version>2.1</version>

<scope>provided</scope>

</dependency>

<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->

<dependency>

<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>

<version>12.4.1.jre11</version>

</dependency>

<dependency>

<groupId>org.glassfish</groupId>

<artifactId>javax.faces</artifactId>

<version>2.4.0</version>

</dependency>

<dependency>

<groupId>org.hibernate.javax.persistence</groupId>

<artifactId>hibernate-jpa-2.0-api</artifactId>

<version>1.0.1.Final</version>

</dependency>

<dependency>

<groupId>org.primefaces</groupId>

<artifactId>primefaces</artifactId>

<version>6.0</version>

</dependency>

<dependency>

<groupId>commons-fileupload</groupId>

<artifactId>commons-fileupload</artifactId>

<version>1.3</version>

</dependency>

<dependency>

<groupId>javax</groupId>

<artifactId>javaee-web-api</artifactId>

<version>8.0.1</version>

<scope>provided</scope>

</dependency>

<dependency>

<groupId>mysql</groupId>

<artifactId>mysql-connector-java</artifactId>
<version>5.0.8</version>

</dependency>

</dependencies>

<build>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<version>3.1</version>

<configuration>

<source>8</source>

<target>8</target>

<compilerArguments>

<endorseddirs>${endorsed.dir}</endorseddirs>

</compilerArguments>

</configuration>

</plugin>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-war-plugin</artifactId>

<version>3.1.0</version>

<configuration>

<failOnMissingWebXml>false</failOnMissingWebXml>

</configuration>

</plugin>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-resources-plugin</artifactId>

<version>3.3.1</version>

</plugin>
<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-dependency-plugin</artifactId>

<version>3.6.0</version>

<executions>

<execution>

<phase>validate</phase>

<goals>

<goal>copy</goal>

</goals>

<configuration>

<outputDirectory>${endorsed.dir}</outputDirectory>

<silent>true</silent>

<artifactItems>

<artifactItem>

<groupId>javax</groupId>

<artifactId>javaee-endorsed-api</artifactId>

<version>7.0</version>

<type>jar</type>

</artifactItem>

</artifactItems>

</configuration>

</execution>

</executions>

</plugin>

</plugins>

</build>

<repositories>

<repository>

<id>unknown-jars-temp-repo</id>

<name>A temporary repository created by NetBeans for libraries and jars it could not identify. Please
replace the dependencies in this repository with correct ones and delete this repository.</name>

<url>file:${project.basedir}/lib</url>
</repository>

<repository>

<url>http://repository.primefaces.org/</url>

<id>PrimeFaces-maven-lib</id>

<layout>default</layout>

<name>Repository for library PrimeFaces-maven-lib</name>

</repository>

<repository>

<id>java.net-m2</id>

<name>java.net - Maven 2</name>

<url>https://repository.jboss.org/nexus/content/repositories/java.net-m2</url>

</repository>

</repositories>

</project>

3. Jalankan build n clean


4. Perhatikan file dibawah ini saling terkait

5. Sesuaikan lagi.
6. Urutan JSF Adalah:
a. Web.xml -> Index -> Controller -> DAO,
IdataAccess, Entity base -> Entity/model
b. Web-INF -> Web-PAGES -> Source Package
(Controller, DAO, Entity)

You might also like