fancy
fancy

Reputation: 2149

JSF html namespace does not work

I'm working with a maven project that deploys a WAR archive to a project that deploys an EAR archive to a JBoss server.

Here is my Facelets code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC 
    "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core">
<h:head>
    <title>title</title>
</h:head>
<h:form>

    <h:body>
        <input type="button" value="babap"></input>
        <h1>Ueberschrift</h1>

        <p>paragraph</p>

        <h:outputText value="outputText" />

        text at bottom
    </h:body>
</h:form>
</html>

Everything seems to work except for <h:outputtext>. it simply doesn't show up on the website. How is this caused and how can I solve it?

Upvotes: 1

Views: 926

Answers (1)

BalusC
BalusC

Reputation: 1108557

everything seems to work except for h:outputtext. it simply doesn't show up on the website.

Did the request URL (the URL as you see in browser's address bar) match the URL pattern of the FacesServlet? If not, then it won't be invoked and thus all the JSF works just won't be performed.

You need to make sure that the request URL matches the URL pattern of the FacesServlet. If it's mapped on *.jsf, then open the page by /foo.jsf instead of /foo.xhtml. Or, better, just change the URL pattern of the FacesServlet in web.xml to *.xhtml. This way you never need to worry about virtual URLs.

Upvotes: 1

Related Questions