Problema Primefaces + JSF

31/10/2021

0

Olá pessoal, estou com um problema numa aplicação que estou desenvolvendo usando JSF e Primefaces, Quando chamo minha pagina pelo botão, ela não consegue redirecionar,
a pagina principal quando tem o botão clickado, passa para a nova pagina, mostra o novo caminho porem mostra a seguinte mensagem:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" template="/pages/layout/template.xhtml">
<ui:define name="titulo">Clientes</ui:define>
<ui:define name="pricipal">
<h:form id="cliente_form">
<p:growl/>
<ui:include src="/pages/clientes/cliente_formulario.xhtml"/>
<ui:include src="/pages/clientes/cliente_lista.xhtml"/>
</h:form>
</ui:define>
</ui:composition>

**template.xhtml:**

> <!DOCTYPE html>
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:ui="http://java.sun.com/jsf/facelets"
> xmlns:h="http://java.sun.com/jsf/html"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:p="http://primefaces.org/ui">
>
> <h:head>
>
> <title>Sistema Alocacar - <ui:insert name="titulo"></ui:insert></title>
>
> <meta charset="utf-8"/>
>
> </h:head>
>
> <h:body>
> <h:form>
>
> <p:menubar>
>
> <p:menuitem value="Cliente" url="/cliente/manutencao/"/>
>
> </p:menubar>
>
> </h:form>
> <ui:insert name="principal"/>
>
> </h:body>
>
> </html>

**clientecad_wrapper.xhtml:**

<ui:composition
template="/pages/layout/template.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">

<ui:define name="titulo">Clientes</ui:define>

<ui:define name="pricipal">

<h:form id="cliente_form">
<p:growl/>
<ui:include src="/pages/clientes/cliente_formulario.xhtml"/>
<ui:include src="/pages/clientes/cliente_lista.xhtml"/>

</h:form>

</ui:define>

</ui:composition>

**web.xml:**

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<display-name>Alocacar</display-name>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<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-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>

<filter>

<filter-name>Pretty Filter</filter-name>

<filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>Pretty Filter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
</web-app>

**pretty-config.xml**

<?xml version="1.0" encoding="UTF-8"?>
<pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.3.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ocpsoft.com/prettyfaces/3.3.3
http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.3.xsd">

<url-mapping id="clientemanutencao">

<pattern value="/cliente/manutencao/"/>
<view-id value="/pages/clientes/clientecad_wrapper.xhtml"/>
<action onPostBack="false">#{clienteBean.iniciarClienteBean}</action>
</url-mapping>

</pretty-config>
Marcos Antonio

Marcos Antonio

Responder

Assista grátis a nossa aula inaugural

Assitir aula

Saiba por que programar é uma questão de
sobrevivência e como aprender sem riscos

Assistir agora

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar