users@javaserverfaces.java.net

Fwd: Defining FacesFlow via xml is bugged?

From: manfred riem <manfred.riem_at_oracle.com>
Date: Tue, 16 Sep 2014 08:15:44 -0500

Forwarding to users list

On 9/16/14, 7:24 AM, Tomasz Głowacki wrote:
> Hello,
> Before i start id like to point, that libraries of framework are added to my
> project via Netbeans 8.0 project properties
> I've been trying to use Flows from JSF 2.2, and had found a few problems. It
> would be very helpful, if you would clarify few things for me.
> On stackoverflow I've asked questions:
> http://stackoverflow.com/questions/25866575/loading-inboundparameters-in-faces-flow-after-initializing-method
> and
> http://stackoverflow.com/questions/25746396/fromoutcome-for-switch-node-directing-flow-to-method-call-node-dont-wont-to
>
> also i'd like to ask about other thing in xml approach of defining new
> Flows:
> why<method-call> node don have ID attribute?
> what about validation? this xml:
>
> <faces-config version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
> http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
>
> <flow-definition id="authors">
> <flow-return id="exit">
> <from-outcome>/authors-return.xhtml</from-outcome>
> </flow-return>
> <method-call>
> <method>#{test.test()}</method>
> <default-outcome>ss</default-outcome>
> </method-call>
> <switch id="authors-switch">
> <case>
> <if>test.test2</if>
> <from-outcome>authors</from-outcome>
> </case>
> <default-outcome>exit</default-outcome>
> </switch>
>
> </flow-definition>
> </faces-config>
>
> when validated in netbeans(Validate XML Alt+F9) gives output:
> XML validation started.
> Checking
> file:/C:/Users/Tomasz/biblioteki/FlowScope/FlowScope/src/main/webapp/authors
> /authors-flow.xml...
> cvc-complex-type.2.4.a: Invalid content was found starting with element
> 'switch'. One of '{"http://xmlns.jcp.org/xml/ns/javaee":method-call,
> "http://xmlns.jcp.org/xml/ns/javaee":initializer,
> "http://xmlns.jcp.org/xml/ns/javaee":finalizer,
> "http://xmlns.jcp.org/xml/ns/javaee":inbound-parameter}' is expected. [14]
> cvc-pattern-valid: Value 'test.test2' is not facet-valid with respect to
> pattern '#\{.*\}' for type 'faces-config-el-expressionType'. [16]
> cvc-complex-type.2.2: Element 'if' must have no element [children], and the
> value must be valid. [16]
> XML validation finished.
>
>
> but "Check XML Shift+Alt+F9" passes with no errors.
> Did i defined something wrong?