JSF, Facelets and HTML 5 mix support on

terrificrecordInternet και Εφαρμογές Web

24 Ιουν 2012 (πριν από 4 χρόνια και 9 μήνες)

516 εμφανίσεις

Generated by Clearspace on 2012-06-24+04:00
1
JSF, Facelets and HTML 5 mix support on...
Sergi Baila 8 posts since
Dec 13, 2010
Hi.

I'm developing a Java EE 6 web app using JSF 2 with facelets templating. During
development I needed to use custom attributes so I went with the HTML 5 standard:

<div class="nota" data-nota="#{nota}" data-alteracion="0">#{nota}</div>

But data-nota and data-alteración show red on my file. This page has no explicit doctype as
it is part of templating. The initial page has XHTML on it but when I've tried to change to this

<!DOCTYPE html>

Then everything goes red. The file extension is .xhtml and I've found that if I use a .html
extension seems to work quite right.

In the past I had the option (intention?) to just add those attributes to a custom list.

Any idea what I can do?

Thanks.
Tags: java, jsf, facelets, idea9, html5
JSF, Facelets and HTML 5 mix support on...
Generated by Clearspace on 2012-06-24+04:00
2
Dmitry Avdeev 607 posts since
Jul 29, 2004 1. Re: JSF, Facelets and HTML 5 mix support on IDEA 10 Dec 14, 2010 4:41 PM
Try to change default HTML language level to HTML5 at Project Settings ->
Resources.


Sergi Baila 8 posts since
Dec 13, 2010 2. Re: JSF, Facelets and HTML 5 mix support on IDEA 10 Dec 14, 2010 5:01 PM
Thanks!

Works quite well. The pages without DOCTYP> work perfect and seems to be recognised as
HTML 5 (the data-* is accepted).

Strangely enough the main page (template) which has the DOCTYPE gives some problems.
If I keep it as XHTML then no html5 is accepted (ex: data-* attributes or canvas tag). But if
I put it as the html5 doctype (<DOCTYPE html>) then all the tags are not accepted. Weird
because that's exactle the html5 doctype explicitly given.

Anyway, works enough for me for the moment.

Thanks!
Dmitry Avdeev 607 posts since
Jul 29, 2004 3. Re: JSF, Facelets and HTML 5 mix support on IDEA 10 Dec 14, 2010 5:43 PM
I cannot reproduce this. Could you attach an example page?
JSF, Facelets and HTML 5 mix support on...
Generated by Clearspace on 2012-06-24+04:00
3

Sergi Baila 8 posts since
Dec 13, 2010 4. Re: JSF, Facelets and HTML 5 mix support on IDEA 10 Dec 14, 2010 6:15 PM
I think the problem is the .xhtml extension. If I switch it to .html seems to work.

Anyway I've created a small project to illustrate it. Just a minor glitch.
Attachments:
• test-html5.zip (11.9 K)
Dmitry Avdeev 607 posts since
Jul 29, 2004 5. Re: JSF, Facelets and HTML 5 mix support on IDEA 10 Dec 14, 2010 6:50 PM
Thanks for your input. This looks like a bug. Could you please submit a
request to YouTrack?


Sergi Baila 8 posts since
Dec 13, 2010 6. Re: JSF, Facelets and HTML 5 mix support on IDEA 10 Dec 14, 2010 6:59 PM
Done!

http://youtrack.jetbrains.net/issue/IDEA-63054