Pessoal estou estudando facelets e estou com uma duvida.
Seque as estrutura do seguinte codigo (Codigo bem simples) :
web.xml
...
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</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>
...
faces-config.xml
...
<faces-config>
<application>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
</faces-config>
...
hello.xhtml
<?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 xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Hello World</title>
</head>
<body>
<h:outputText value="Hello World!"/>
</body>
</html>
</ui:composition>
</jsp:root>
Se eu entrar com http://localhost:8085/aplicacao/hello.jsf ok aparecera o html normal.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
...
Agora se eu entrar com http://localhost:8085/aplicacao/hello.xhtml ele aparece o código ao qual o facelets deveria processar
<?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>
...
qual seria a maneira exata de fazer com que o jsf não deixe o usuario acessar o xhtml diretamnete.
Se não fui claro digam ai… :lol: