[jsr-314-open] Inconsistency between Spec and XSD for include-view-params

Dan Allen dan.j.allen at gmail.com
Tue Aug 4 14:51:42 EDT 2009


Neil Griffin is asking about the include-view-params attibute/element in
faces-config.xml. I reply to his inquiry inline.

---------- Forwarded message ----------
> From: Neil Griffin <neil.griffin at liferay.com>
> Date: Sat, Aug 1, 2009 at 7:46 PM
> Subject: Inconsistency between Spec and XSD for include-view-params
> To: jsr-314-comments at jcp.org
>
> Hi there again Guys,
>
> Section 7.4.3 of the Spec has an example navigation-handler, which shows
> how to use the include-view-params feature:
>
> <redirect>
>  <view-param>
>    <name>userId</name><value>someValue</value>
>  </view-param>
>  <include-view-params>true</include-view-params>
> </redirect>
>
> However, using <include-view-params> as an XML element is invalid according
> to web-facesconfig_2_0.xsd
>

Clearly they need to be made the same, one way or another.


>
>
> But then, in section 7.4.2, the Spec talks about the "include-view-params"
> attribute on the <redirect /> element, like this:
>
> <redirect include-view-params="true" />
>
> The attribute syntax is what the XSD wants, and what Ryan's blog [1])
> claims as well.
>

To be hones, I can't remember what the final decision was.


>
> Having said that, if the attribute way is the right syntax, then I think
> there are two problems with it:
>
> 1. Although I prefer attribute-syntax for XML, the faces-config.xml file
> doesn't use XML attributes anywhere.Instead, it uses the verbose
> <element>#PCDATA</element> syntax. So having an attribute on <redirect /> is
> really inconsistent with the rest of the file.
>

False. The root element has "id", "version" and "metadata-complete"
attributes. The "id" attribute is allowed on many other elements as well.


2. it's really inconsistent and weird to have
dashes-in-the-name-of-an-xml-attribute. For example, we use camelCase for
actionListener:

       <h:commandButton actionListener="#{myBean.actionListener}" />

Again, false. The dashes in the name of an XML attribute is standard for
Java EE config files. See persistence.xml. The others only have
metadata-complete as an example.

3. The functionality/purpose of this include-view-parameters feature is
really confusing. Does it mean:

       A. Include/exclude the f:viewParam stuff found in f:metaData of the
from-view-id?
       B. Include/exclude the <view-param> children of the <redirect>
element?
       C. Both A & B?

A.

The idea is that when constructing the URL to navigate to, should that URL
be "enhanced" with the view parameters or should it be left as is. The
<view-param> children of the <redirect> element are explicit and should
never be left off. Otherwise, you wouldn't put them there. The view
parameters are considered "magic" in this sense (i.e., not explicit).

-Dan

-- 
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20090804/c1a76751/attachment.html 


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