JAVASERVERFACES_SPEC_PUBLIC-1423 Reproducer
This project is a reproducer for JAVASERVERFACES_SPEC_PUBLIC-1423: Dynamic resource loading in ajax requests
-
Clone the project:
git clone https://github.com/stiemannkj1/dynamic-resource-loading-ajax-reproducer.git -
Build the project with maven. You can use the
myfacesprofile to use myfaces instead of mojarra (for example:-P myfaces). You can use thejsf.versionproperty to change the version of JSF being used (for example:-Djsf.verison=2.3.0-m06).cd dynamic-resource-loading-ajax-reproducer && mvn clean install -
Deploy the project to tomcat:
cp target/dynamic-resource-loading-ajax-reproducer*.war $TOMCAT_HOME/webapps/
Steps to reproduce by programmatically (dynamically) adding a component with a @ResourceDepedency to the view via java:
-
Verify that the
example.jsresource dependency is loaded when the<example:component rendered="false" />is included in the facelet view:-
Navigate to
static.facesin the browser:http://localhost:8080/dynamic-resource-loading-ajax-reproducer-1.0-SNAPSHOT/static.faces
-
Verify that an alert with the text "example.js resource loaded" appears.
-
-
Navigate to
dynamic.facesin the browser:http://localhost:8080/dynamic-resource-loading-ajax-reproducer-1.0-SNAPSHOT/dynamic.faces
-
Click the Add Example Component Via Ajax button.
If the feature does not exist, "example:component rendered" will appear, but the alert showing that example.js was loaded will not appear.
If the feature exists then an alert with the text "example.js resource loaded" will appear.
Steps to reproduce by programmatically (dynamically) changing the src attribute of a ui:include tag:
-
Verify that the
example.jsresource dependency is loaded when the<example:component />is included statically:-
Navigate to
staticInclude.facesin the browser:http://localhost:8080/dynamic-resource-loading-ajax-reproducer-1.0-SNAPSHOT/staticInclude.faces
-
Verify that an alert with the text "example.js resource loaded" appears.
-
-
Navigate to
dynamicInclude.facesin the browser:http://localhost:8080/dynamic-resource-loading-ajax-reproducer-1.0-SNAPSHOT/dynamicInclude.faces
-
Click the Toggle Include button.
If the feature does not exist, "example:component rendered" will appear, but the alert showing that example.js was loaded will not appear.
If the feature exists then an alert with the text "example.js resource loaded" will appear.