OK, so I am trying to set up a simple JSF application. I'm using NetBeans 6.8, Glassfishv3 and Maven2. I made a JSP document like so:
<?xml version="1.0" encoding="utf-8"?>
<html xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<f:view>
<head>
<title><h:outputText value="#{Welcome.title}"/></title>
</head>
<body>
<h:outputText value="Welcome"/>
</body>
</f:view>
</html>
Problem is, if I navigate to this page (http://myHost/myApp/faces/welcome.jspx
), it is returned as an XML document, but with the ${Welcome.title}
value populated:
<?xml version="1.0" encoding="UTF-8"?>
<html><head><title>Gymix - Welcome</title></head><body>Welcome</body></html>
In Internet Explorer this looks like I would have opened an XML document. In Google Chrome the title is printed next to the text Welcome and instead of the title the URL to the page is printed on the tab.
If I change the JSP document to a plain JSP page (taglibs instead of xmlns and so on) it works and I get a proper page returned. Any ideas on what's wrong? Thanks!
Edit: sadly none of the quick fixes fixed this, so I'll look into this more. BTW, my pom.xml has jsf-api and jsf-impl dependencies with the version for both set to 1.2_14