0

This is data from jsf-ibm.jar (MANIFEST.MF file), in order to provide info
about the version of jsf which is being used by the application I am currently working on:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Created-By: IBM Corporation
Specification-Title: Java Server Faces
Implementation-Title: JSF Widget Library (JWL) - Base
Implementation-Version: JWL v3_1_13
Implementation-Vendor: IBM
Build-Version: 20120307.2306
Build-Date: March 7 2012
Copyright-Info: Copyright (c) 2003,2008, International Business Machin
es Corporation.  All Rights Reserved.

In faces-config.xml file I have:

<navigation-rule>
    <from-view-id>/myapp/books/bookA.jsp</from-view-id>
    <navigation-case>
        <from-action>#{controller.doSaveAction}</from-action>                   
        <from-outcome>SUCCESS</from-outcome>
        <to-view-id>/myapp/books/somePage.jsp</to-view-id>
    </navigation-case>  
</navigation-rule>

My question is about from-view-id tag.
For business needs, application has 2 projects, e.g. Project and ExternalProject.
Each of this two projects contains page bookA.jsp:
- Project/WebContent/myapp/books/bookA.jsp and
- ExternalProject/WebContent/myapp/books/bookA.jsp

So, does this navigation-rule, defined in faces-config.xml file, applies in both cases (for both projects/apps - Project and ExternalProject)? Or do you know that something like that would be specified somewhere else (currently, I don't know where, I have searched faces-config.xml file by project names, but found nothing ... :))?

Any kind of information is very appreciated.
Thank you in advance.

Best regards,
mismas

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
mismas
  • 1,236
  • 5
  • 27
  • 55

1 Answers1

1

If there are multiple resources with the same name, then the one in the webapp always overrules the one in the external library, regardless of where the navigation rule is defined. So in your particular example, the Project/WebContent/myapp/books/bookA.jsp would be returned and the ExternalProject/WebContent/myapp/books/bookA.jsp would never be used (noted should be that JSP's successor Facelets allows you to control this with a custom ResourceResovler).

This mechanism enables developers to overrule "broken" or "invalid" resources from the webapp side on without the need to change the external library and/or waiting for external library maintainers to provide a version with the bugfix/improvement.

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555