[jsr-314-open] Facelets: XHTML vs. XML

Dan Allen dan.j.allen at GMAIL.COM
Sun May 10 02:38:11 EDT 2009


On Sat, May 9, 2009 at 4:00 PM, David Geary <clarity.training at gmail.com>wrote:

> 2009/5/7 Norbert Truchsess <norbert.truchsess at t-online.de>
>
>> you can ommit the xml-declaration being passed through by using
>> ui:composition:
>>
>> <?xml version='1.0' encoding='utf-8'?>
>> <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets">
>>      xmlns:f="http://java.sun.com/jsf/core"
>>     xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
>>   <f:view>
>>    <af:document/>
>>  </f:view>
>> </ui:composition>
>
>
> Yes, and this should be a recommended practice, should it not?
>
> However, the preceeding fragment is XML, not XHTML. If you have a view
> implemented as a composition, and you reference it as an action of a button
> or link, the corresponding file must have a .xhtml extension, or the
> navigation handler won't find it. IOW...
>
> <h:commandButton ... action="welcome"/>
>
> ...means the navigation handler will look for welcome.xhtml. If you name
> the file welcome.xml, you get an error message at runtime. But if
> welcome.xhtml uses a composition, like the preceeding code fragment, it's
> not an XHTML file, it's XML. Ugh.
>
> Should the navigation handler also look for welcome.xml, or is that too
> naiive of a fix?
>

Why don't you just make the javax.faces.DEFAULT_SUFFIX .xml? I suppose you
want to have a gradual migration. In that case, why can't JSF support
multiple extensions, searched in priority order. I guess that is something
an impl could provide (since migrations are something that you might look to
a vendor to help you solve). The spec should assume you are using a single
type (I guess).

-Dan

-- 
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan

NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a message if
you feel that it did not reach my attention.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20090510/7fdc7cd7/attachment.html 


More information about the jsr-314-open-mirror mailing list