2
votes

In Eclipse Indigo (for Java EE Developers, JBoss Tools are installed) I
created new "Dynamic Web Project",
enabled the JSF v 2.0 from Project Facets and
added xhtml file whose content is below:

<!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:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head></h:head>
<body>
    <h:messages layout="table" />
</body>
</html>

Now I want to see validation warnings / errors when I change the JSF tag or its attribute to some invalid value like these:
Invalid tag <h:barfoo layout="table" />
Invalid attribute <h:messages barfoo="table" />
Invalid attribute val <h:messages layout="barfoo" />
Currently I cannot see any warnings for all 3 ones in Eclipse. How can I validate the page?
The autocompletion (Ctrl+Space) is just working fine for tags and attributes. JBoss AS 7.1.1 is registered to Eclipse.

1

1 Answers

0
votes

I've also had this problem a couple of times. You need to understand that an xhtml page can contain anything, plain text, JavaScript, html tags as well as lots of other types of tags. now the h: prefix is meant to indicate jsf tags, but remember you can also create custom tags that extend the h: prefix. So even though the tags are not available at the default namespace. eclipse won't warn you, however it will fail at runtime. you will get validation warnings if your xml is not well formed, but that's about it. That's one of the downsides of xml being so malleable.