0
I am studying JSF using the eclipse IDE, but am finding a certain problem when running my application. When I run the application by clicking on the project itself, it doesn’t seem to load my created template.
Following example:
However, when I run by directly clicking on the page I want to display, the template loads correctly.
index.xhtml
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
template="/WEB-INF/templates/Layout.xhtml">
<ui:define name="content">Bem-Vindo</ui:define>
</ui:composition>
Layout.xhtml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<h:head>
<title>Log Horizon</title>
</h:head>
<h:body>
<h1>Teste de Layout</h1>
<hr />
<ui:insert name="content"></ui:insert>
</h:body>
</html>
This happens in every project I create. What I could be doing wrong?
I hadn’t noticed that detail faces. Thank you very much, Lucas.
– Ryan Santos