Skip to content

Commit

Permalink
Mudança na versão do jsf e arquivo web.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcos Estevam de Sousa committed Aug 4, 2017
1 parent 2698c30 commit a37231f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 44 deletions.
40 changes: 18 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,45 +1,41 @@
<?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/maven-v4_0_0.xsd">
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>br.com.example</groupId>
<artifactId>ibge</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>ibge Maven Webapp</name>
<url>http://maven.apache.org</url>

<build>
<finalName>ibge</finalName>
</build>
<properties>
<failOnMissingWebXml>false</failOnMissingWebXml>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<!-- Versão do JSF -->
<dependency>
<groupId>org.jboss.spec.javax.faces</groupId>
<artifactId>jboss-jsf-api_2.1_spec</artifactId>
<version>2.0.1.Final</version>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
</dependency>

<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>6.0</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>

</dependencies>

<build>
<finalName>ibge</finalName>
</build>


</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.annotation.PostConstruct;
import javax.faces.bean.ViewScoped;
import javax.faces.bean.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;

import br.com.example.model.Municipio;
import br.com.example.model.Uf;
import br.com.example.rest.service.MunicipioRestService;
import br.com.example.rest.service.UfRestService;

@Named
@ViewScoped
@RequestScoped
@ManagedBean
public class MunicipioController implements Serializable {


Expand Down
14 changes: 7 additions & 7 deletions src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<display-name>ibge</display-name>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- <servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping> -->
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
15 changes: 4 additions & 11 deletions src/main/webapp/index.xhtml
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">

<h:head>
<title>IBGE - Listagem UF e Municipios</title>
</h:head>
<body>
<h:form>
<h:outputText value="test" />
<h:outputText value="#{municipioController.nome}" />
</h:form>
<h:body>
<div align="center">
<fieldset>
<legend>Dados UF e Municipios</legend>
<p>campos</p>



<h:outputText value="#{municipioController.nome}" />
</fieldset>
</div>

</body>
</html>
</h:body>
</html>

0 comments on commit a37231f

Please sign in to comment.