This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 244865 - Validation of faces-config.xml fails erroneously
Summary: Validation of faces-config.xml fails erroneously
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF (show other bugs)
Version: 8.0
Hardware: PC Windows 7 x64
: P2 normal (vote)
Assignee: Martin Fousek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-03 13:24 UTC by _ alexstevenson
Modified: 2014-06-21 04:40 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ alexstevenson 2014-06-03 13:24:59 UTC
faces-config.xml file generated using 'JSF Pages from Entity Classes' feature.
The start of the file is
<?xml version='1.0' encoding='UTF-8'?>
<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">
    <application>
        <el-resolver>prototype80.controller.util.JsfCrudELResolver</el-resolver>
    </application>
    <navigation-rule>
        <navigation-case>
            <from-view-id>welcome</from-view-id>
            <to-view-id>/welcomeJSF.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>

 Project launches and welcomeJSF.jsp page displays but commandLink 'actions' do not work. Selecting Validate XML from within faces-config.xml file outputs
" cvc-complex-type.2.4.a: Invalid content was found starting with element 'navigation-case'. One of '{"http://xmlns.jcp.org/xml/ns/javaee":description,. . . is expected". As well as 'description', the ellipsis mark relates to tag values 'display-name', 'icon' and 'from-view-id'. This output is repeated for all 'navigation-case' elements.

Also output is " cvc-complex-type.2.4.a: Invalid content was found starting with element 'from-view-id'. One of '{"http://xmlns.jcp.org/xml/ns/javaee":description,. . . is expected". As well as 'description', the ellipsis mark relates to tag values 'display-name', 'icon', 'from-action', 'if' and 'to-view-id'. Element 'from-view-id' is generated only once. Subsequently the content generated for 'navigation-case' starts with 'from-outcome' which produces no output.
Comment 1 Vladimir Riha 2014-06-03 16:33:00 UTC
Reproducible in 8.0 and Dev if page language is set to JSP.
Comment 2 _ alexstevenson 2014-06-04 14:28:31 UTC
Within 'JSF Pages from Entity Classes . . .' wizard, Page Language JSP was selected.
Comment 3 Martin Fousek 2014-06-20 06:25:34 UTC
According to the documentation your runtime should work. It works to me but you are right that the faces-config is not valid then. I found this documentation:

"Tip:
When defining a global navigation rule, you can exclude the from-view-id element. However, for the sake of clarity in the faces-config.xml file, you may want to specify the value as <from-view-id>* </from-view-id> or <from-view-id>/*</from-view-id>, with the former being the preferred approach. All of these styles produce the same result—the rule is applied to all pages in the application."

see: http://otndnld.oracle.co.jp/document/products/as10g/101300/B25221_03/web.1013/b25386/web_PageNavigation002.htm

So I'm going to complete the XML to make it valid, but I'm afraid that your runtime error lies somewhere else.
Comment 4 Martin Fousek 2014-06-20 08:18:28 UTC
Fixed in web-main #025b7c38cd7b.
Comment 5 Quality Engineering 2014-06-21 04:40:49 UTC
Integrated into 'main-silver', will be available in build *201406210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/025b7c38cd7b
User: Martin Fousek <marfous@netbeans.org>
Log: #244865 - Validation of faces-config.xml fails erroneously