Gente, estou iniciando no mundo do Java Enteprise Edition, comecei a fazer minha primeiro projeto web usando maven, tomcat versão 8 no eclipse, porém quando crio minhas páginas xhtml e redenrizo no navegador os campos inputText não são redenrizado. Alguém pode me ajudar?
Mostra seu XHTML, seu web.xml e se puder quais as Libs vc esta usando
arquivo XHTML
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
</h:head>
<h:body>
<h1>Novo Livro</h1>
<h:form>
<fieldset>
<legend>Dados do livro</legend>
<h:panelGrid columns="2">
<h:outputLabel value="Titulo" for="titulo"/>
<h:inputText id="isbn" />
<h:outputLabel value="ISBN" for="isbn"/>
<h:inputText id="isbn" />
<h:outputLabel value="Preço:" for="preco"/>
<h:inputText id="preco" />
<h:outputLabel value="Data de Lançamento" for="dataLancamento"/>
<h:inputText id="dataLancamento" />
<h:commandButton value="Gravar"/>
</h:panelGrid>
</fieldset>
</h:form>
</h:body>
</html>
WEB.XML
<?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" 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>jsf-livraria</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
<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>br.com.alura</groupId>
<artifactId>jsf-livraria</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.2.10</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Altera seu web.XML para o que esta abaixo
<?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/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>JavaServerFaces</display-name>
<!-- Welcome page -->
<welcome-file-list>
<welcome-file>faces/hello.xhtml</welcome-file>
</welcome-file-list>
<!-- JSF mapping é de extrema importância colocar o controlador faces servlet é ele que vai fazer todo o processo do ciclo do de vida do jsf, inclusive renderizar os componentes jsf -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map these files with JSF aqui VC vai especificar de qual maneira será chamado o arquivo-->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
</web-app>
Olá,
Você está fazendo o curso Curso Java e JSF I: Sua aplicação web com JSF2 da Alura ? Em caso afirmativo, porque não pergunta no fórum desse curso?
Coloquei também lá, mas para receber uma resposta mais rápida e mais possibilidades de soluções resolver postar aqui tambem
No meu caso específico, apenas fui nas propriedades do projeto e desabilitei o JS Implementation Library