I have a project where I have to make a JSF page, Servlet and couple of Beans and deploy it to the Tomcat.
When I create a JSF application in IntelliJ Idea everything works perfectly (well, except for adding Apche Commons libs, but that is a known issue).
But when I try to add all the libraries needed to the existing (originally non-jsf) project, it renders incorrectly:
As you can see, there are still <h:...>
tags and two body tags. When rendering the same page in originally non-jsf project I get this:
The code of the page is following (nevermind it's weirdness, it's completely devoted to testing the output):
<?xml version="1.0" encoding="UTF-8"?>
<!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://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough">
<h:head>
<h:outputStylesheet library="css" name="main.css"/>
<title>Synchronization</title>
</h:head>
<h:body>
<h:form id="start" action="synch" method="post">
<h:button h:form="start">Start</h:button>
<p:commandButton styleClass="buttonLeft" value="Синхронизация"
action="synchronization?faces-redirect=true"
immediate="true"/>
</h:form>
<p:editor value="lol?" />
</h:body>
</html>
The only difference is that in originally non-jsf project filename is index.jsp
, and in jsf project it's index.xhtml
.
Any help?