Neil Griffin is asking about the include-view-params attibute/element in faces-config.xml. I reply to his inquiry inline.<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
<div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Neil Griffin</b> <span dir="ltr"><<a href="mailto:neil.griffin@liferay.com">neil.griffin@liferay.com</a>></span><br>
Date: Sat, Aug 1, 2009 at 7:46 PM<br>Subject: Inconsistency between Spec and XSD for include-view-params<br>To: <a href="mailto:jsr-314-comments@jcporg">jsr-314-comments@jcp.org</a><br><br>Hi there again Guys,<br>
<br>
Section 7.4.3 of the Spec has an example navigation-handler, which shows how to use the include-view-params feature:<br>
<br>
<redirect><br>
<view-param><br>
<name>userId</name><value>someValue</value><br>
</view-param><br>
<include-view-params>true</include-view-params><br>
</redirect><br>
<br>
However, using <include-view-params> as an XML element is invalid according to web-facesconfig_2_0.xsd</div></blockquote><div><br>Clearly they need to be made the same, one way or another.<br> <br></div><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
<div class="gmail_quote"><br>
<br>
But then, in section 7.4.2, the Spec talks about the "include-view-params" attribute on the <redirect /> element, like this:<br>
<br>
<redirect include-view-params="true" /><br>
<br>
The attribute syntax is what the XSD wants, and what Ryan's blog [1]) claims as well.</div></blockquote><div><br>To be hones, I can't remember what the final decision was.<br> </div><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
<div class="gmail_quote"><br>
Having said that, if the attribute way is the right syntax, then I think there are two problems with it:<br>
<br>
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.</div>
</blockquote><div class="gmail_quote"><br>
False. The root element has "id", "version" and "metadata-complete"
attributes. The "id" attribute is allowed on many other elements as
well.<br> <br>
<br>
2. it's really inconsistent and weird to have dashes-in-the-name-of-an-xml-attribute. For example, we use camelCase for actionListener:<br>
<br>
<h:commandButton actionListener="#{myBean.actionListener}" /><br><br>Again, false. The dashes in the name of an XML attribute is standard for Java EE config files. See persistencexml. The others only have metadata-complete as an example.<br>
<br>
3. The functionality/purpose of this include-view-parameters feature is really confusing. Does it mean:<br>
<br>
A. Include/exclude the f:viewParam stuff found in f:metaData of the from-view-id?<br>
B. Include/exclude the <view-param> children of the <redirect> element?<br>
C. Both A & B?<br><br>A.<br><br>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).<br>
<br>-Dan<br>
</div><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br><a href="http://mojavelinuxcom/seaminaction">http://mojavelinux.com/seaminaction</a><br>
<a href="http://in.relation.to/Bloggers/Dan">http://in.relation.to/Bloggers/Dan</a><br>