JSF plugin wants <%-- comments, Tomcat wants <!-- comments in JSP file.

I'm working on some JSF/Facelets code and when I use the intention to
add an annotation comment, the comment starts with <%--

IDEA is happy - it recognizes all of the symbols, token completion works.

Tomcat is not happy:

javax.servlet.ServletException: Error Parsing /index.jsp: Error
Traced[line: 1] The markup in the document preceding the root element
must be well-formed.

If I try to use a regular HTML/JSP comment <!-- the JSF plugin just
ignores it.

Obviously I must be missing something here. Any ideas?

Donald

4 comments

Could you attach a fragment of your jsp containing the comment?

0

Dmitry Avdeev wrote:

Could you attach a fragment of your jsp containing the comment?


Sure. We're doing technology evaluation so attached is actually the
whole file - as it actually works on the server. IDEA gives errors for
the first three #{ constructions (Cannot convert string
#{pollBean.pollEnabled} to target class java.lang.Boolean) and warnings
for the other five (JSF EL out of attribute). If I change all of the #{
constructs to ${ then IDEA is happier, but says that the first three are
still errors. For the other five it complains about pollBean not being
defined until I put:

<%@elvariable id="pollBean" type="edu.stsci.PollBean"%>

At the top. Tomcat chokes on the <%-- sequence but if I change it to:

<!@elvariable id="pollBean" type="edu.stsci.PollBean">

Then IDEA says that pollBean is not defined.

I have attached all of the project files so that you can see exactly
what we're doing - and the Ant build file shows which versions of the
various libraries we are using.

It's a bit annoying that code that actually works is so badly disliked
by IDEA.

Donald



Attachment(s):
faces-config.xml
web.xml
build.xml
0

I see. You are using facelets xhtml format, not jsp. Change your file
extension to xhtml or to jspx, or map .jsp extension to JSPX file type (that
is not recommended).

0

Dmitry Avdeev wrote:

I see. You are using facelets xhtml format, not jsp. Change your file
extension to xhtml or to jspx, or map .jsp extension to JSPX file type
(that is not recommended).


Much better. Thank you!

Donald

0

Please sign in to leave a comment.