Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Blocker Blocker
Assignee: rogerk
Reporter: mojavelinux
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

Option to suppress xml declaration in Facelets

Created: 11/Dec/09 02:42 PM   Updated: 07/Jun/11 05:23 PM   Resolved: 03/Nov/10 03:04 PM
Component/s: Facelets/VDL
Affects Version/s: 2.0
Fix Version/s: 2.1

Time Tracking:
Not Specified

File Attachments: 1. Text File changebundle.txt (16 kB) 26/Jul/10 01:11 PM - Ed Burns


Operating System: All
Platform: All

Issuezilla Id: 696
Status Whiteboard:

size_large importance_large

Tags: adf changelog_2_1
Participants: driscoll, Ed Burns, Hanspeter Duennenberger, mojavelinux and rogerk

 Description  « Hide

The XML declaration is added to the Facelets template to make the tooling happy,
but Facelets allows this markup to pass straight through the browser. The
problem is that there are certain browsers which choke (or behave differently)
when the XML declaration is included in the rendered response.

The XML declaration really has no business being in the rendered output, so the
best approach is to have Facelets suppress this markup. But if there are
developers who prefer it, perhaps because they are using Facelets to generate an
XML feed, then there should be a setting somewhere that allows them to control
the terminus of the declaration (either suppressed or passed through). This is
no different than the "omitXmlDeclaration" setting on most XML printers,
including XSLT.

What's odd is that Facelets does not pass through the DTD declaration, which is
arguably even more of a problem. However, there is an easy workaround. Simply
include a DTD-generating tag.

mojavelinux added a comment - 11/Dec/09 02:48 PM

Target milestone.

mojavelinux added a comment - 11/Dec/09 03:47 PM

Also, the same problem exists for CDATA.

We (quoting Andy Schwartz) run into similar problems with CDATA sections. For
example, the following code uses the Trinidad trh:script component to insert a
script into the page:

if (0 < 1) alert("Woohoo! Zero is less than one!");

The CDATA section is meant to apply to the Facelets page itself - not to the
generated content. That is, the CDATA section provides a way to tell the
Facelets parser not to parse the specified character data. This is not intended
to be used as an instruction to the browser (just to Facelets XML parser).
However, Facelets passes the CDATA through to the browser. As a result, in the
case where we render HTML content, we end up with bogus CDATA sections inside of
our generated HTML document, which causes the browsers to get confused.

driscoll added a comment - 11/Dec/09 03:55 PM

Unforunately, unlike the xml declaration (which you'll almost always want to
leave off, thanks MS), CDATA is something that you'll often want to include in
your page.

In fact, CDATA is something that users may want to include in the page sent to
the browser in the same page as a CDATA block that they don't want to send to
the browser. Ick.

In the specific case mentioned, the Trinidad script component, it should be
possible for the component to detect and properly process the included text -
that's what Mojarra does for script tags, in fact.

So, I'd love to see a different example, if anyone has one.

mojavelinux added a comment - 18/Dec/09 01:22 PM

Update target milestone to 2.0 Rev a

Ed Burns added a comment - 04/Mar/10 11:42 AM


Ed Burns added a comment - 17/May/10 06:41 AM

Move to 2.1

Ed Burns added a comment - 22/Jun/10 09:02 PM


Ed Burns added a comment - 22/Jun/10 09:41 PM


Ed Burns added a comment - 24/Jun/10 02:41 PM

GlassFish 3.1 M6 at the latest.

Ed Burns added a comment - 24/Jun/10 02:55 PM

Move these to M5

Ed Burns added a comment - 22/Jul/10 12:39 PM

Move to M4. Add ADF keyword because it's related to issue 697.

Ed Burns added a comment - 26/Jul/10 01:11 PM

Created an attachment (id=262)
Fix for this bug, first iteration.

Ed Burns added a comment - 27/Jul/10 08:06 AM

Fix checked in. r8517

Hanspeter Duennenberger added a comment - 27/Jul/10 08:20 AM


Ed Burns added a comment - 13/Sep/10 10:59 AM

add changelog_2_1 keyword

Ed Burns added a comment - 20/Sep/10 05:38 PM

Ensure changelog_2_1 is in keywords list

Ed Burns added a comment - 01/Nov/10 01:26 PM

This needs to be removed from the spec in favor of what we have in <facelets-processing>

Ed Burns added a comment - 01/Nov/10 01:26 PM


Ed Burns added a comment - 03/Nov/10 12:33 PM

Committed revision 8701.
Rolled this out in favor of what we did on issue 490.

Ed Burns added a comment - 03/Nov/10 03:04 PM

Resolved in issue 490.