Problems getting IntelliJ to play wth JSF

I wrote a few months ago a very simple JSF page with an older build of
IntelliJ 6.0 and it worked. Now, I'm trying to rewrite the same example
but without luck.

First, the JSF tags appear all in red. After some research, it appears
that I should use a jspx type of file instead of a jsp (I don't
understand why but I do it anyway). Well, now the every occurrence of
"<%@" is underlined in red and when hovering with the mouse, it says
"Element is not closed". Of course it's closed according to me. Ex:

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

Also this later problem causes all the tags referring to taglibs to be
also underlined in red and IntelliJ pointing that the "Namespace f is
not bound".

Any idea on what I'm doing wrong? I have the exact same page working (as
a jsp not a jspx) on a different project but used an older build of
IntelliJ.

Thank you

P.S. Could someone please, point me to some url where I can found some
info on how to use JSF with IntelliJ? Thanks again.

2 comments
Comment actions Permalink

Angel Municio wrote:

I wrote a few months ago a very simple JSF page with an older build of
IntelliJ 6.0 and it worked. Now, I'm trying to rewrite the same example
but without luck.

First, the JSF tags appear all in red. After some research, it appears
that I should use a jspx type of file instead of a jsp (I don't
understand why but I do it anyway). Well, now the every occurrence of
"<%@" is underlined in red and when hovering with the mouse, it says
"Element is not closed". Of course it's closed according to me. Ex:

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

Also this later problem causes all the tags referring to taglibs to be
also underlined in red and IntelliJ pointing that the "Namespace f is
not bound".

Any idea on what I'm doing wrong? I have the exact same page working (as
a jsp not a jspx) on a different project but used an older build of
IntelliJ.

Thank you

P.S. Could someone please, point me to some url where I can found some
info on how to use JSF with IntelliJ? Thanks again.


AFAIK, the "<%" tags are illegal in a jspx file (as a jspx file (unlike
a jsp file) is an XML file).

Instead, use a root element such as

<jsp:root xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:f="http://java.sun.com/jsp/jstl/core"
xmlns:h="http://java.sun.com/jsp/jstl/html"
version="2.0">

and put your content inside that element.

Regards,
Jens

0
Comment actions Permalink

JSF file type should be working 100% ok. Please check that you have
correctly set up your web application and tag libraries.

0

Please sign in to leave a comment.