Move JAVASERVERFACES_SPEC_PUBLIC-949 test to be non-cluster due to the nature of the test

git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9733 761efcf2-d34d-6b61-9145-99dcacc3edf1
http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-719


SECTION: Modified Files
----------------------------
M       jsf-demo/sandbox/ezcomp02/src/main/webapp/WEB-INF/web.xml
M       jsf-demo/sandbox/ezcomp02/build.xml

- this app was useful in the discovery phase.  Clean it up a bit.



git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9734 761efcf2-d34d-6b61-9145-99dcacc3edf1
http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1071

SECTION: Modified Files
----------------------------
M       jsf-ri/src/main/java/com/sun/faces/config/processor/FactoryConfigProcessor.java

- Add FlashFactory to the FactoryConfigProcessor validation.


git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9735 761efcf2-d34d-6b61-9145-99dcacc3edf1
http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-949


SECTION: Modified Files
----------------------------
M       jsf-api/src/main/java/javax/faces/render/ResponseStateManager.java
M       jsf-api/src/main/resources/jsf.js

- Change the spec for the WindowId parameter to require the
  UIViewRoot.getContainerClientId() to be prepended.

M       jsf-ri/src/main/java/com/sun/faces/util/Util.java

- Implement the requirement


git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9737 761efcf2-d34d-6b61-9145-99dcacc3edf1
http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-949

SECTION: Modified Files
----------------------------
M       jsf-api/src/main/resources/jsf.js

- New implementation of getWindowId(), contributed by Werner Punz.  Note
  that existing license header is sufficient to cover this contribution.


git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9738 761efcf2-d34d-6b61-9145-99dcacc3edf1
http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-949

SECTION: Modified Files
----------------------------
M       jsf-api/src/main/resources/jsf.js

- New implementation of getWindowId(), contributed by Werner Punz.  Note
  that existing license header is sufficient to cover this contribution.


git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9739 761efcf2-d34d-6b61-9145-99dcacc3edf1
2.2.0-m01

git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9743 761efcf2-d34d-6b61-9145-99dcacc3edf1
SNAPSHOT

git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9744 761efcf2-d34d-6b61-9145-99dcacc3edf1
Disabling spurious Lifecycle tests (Cactus) on trunk so real test failures can become visible

git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9745 761efcf2-d34d-6b61-9145-99dcacc3edf1
http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-703

Make "value" optional for @FacesComponent.

At this point, all you need to say to have a complete UIComponent with
tag and everything is

@FacesComponent(createTag=true)
public class MyComponent extends UIComponent*


SECTION: Modified Files
----------------------------
M       jsf-api/src/main/java/javax/faces/component/FacesComponent.java

- Spec language for now optional value attribute.

M       jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/FacesComponentTagLibrary.java
M       jsf-ri/src/main/java/com/sun/faces/application/annotation/ComponentConfigHandler.java
M       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-594/i_spec_594_war/src/main/java/com/sun/faces/test/i_spec_594_war/components/TagNameDerivedFromClassName.java


git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9746 761efcf2-d34d-6b61-9145-99dcacc3edf1
http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-703

SECTION: Spec changes
---------------------

M       jsf-api/src/main/java/javax/faces/validator/FacesValidator.java
M       jsf-api/src/main/java/javax/faces/validator/package.html
M       jsf-api/src/main/java/javax/faces/convert/FacesConverter.java
M       jsf-api/src/main/java/javax/faces/convert/package.html

- Require that FacesValidator and FacesConverter do not require a
  "value" attribute and specify what should happen in the absence thereof.

SECTION: impl changes
---------------------

M       jsf-ri/src/main/java/com/sun/faces/application/annotation/ValidatorConfigHandler.java
M       jsf-ri/systest/src/com/sun/faces/annotation/AnnotationTestBean.java
M       jsf-ri/systest/build.xml
A  +    jsf-ri/systest/src/com/sun/faces/annotation/AnnotatedValidatorNoValue.java

- Implement and test the FacesValidator portion of the spec changes.
  The FacesConverter portion must be implemented and is tracked as 
  <http://java.net/jira/browse/JAVASERVERFACES-2342>.


git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9747 761efcf2-d34d-6b61-9145-99dcacc3edf1
http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-719

- Make it so Facelets are loaded by the ResourceHandler.

SECTION: Modified Files
----------------------------
M       jsf-ri/test/com/sun/faces/application/resource/TestResourceManager.java
M       jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultResourceResolver.java
M       jsf-ri/src/main/java/com/sun/faces/application/ApplicationAssociate.java
M       jsf-ri/src/main/java/com/sun/faces/application/resource/ResourceInfo.java
M       jsf-ri/src/main/java/com/sun/faces/application/resource/ResourceImpl.java
M       jsf-ri/src/main/java/com/sun/faces/application/resource/ResourceManager.java
M       jsf-ri/src/main/java/com/sun/faces/application/resource/WebappResourceHelper.java
M       jsf-ri/src/main/java/com/sun/faces/application/resource/ResourceHelper.java
M       jsf-ri/src/main/java/com/sun/faces/application/resource/ClasspathResourceHelper.java
A  +    jsf-ri/src/main/java/com/sun/faces/application/resource/ClientResourceInfo.java
A       jsf-ri/src/main/java/com/sun/faces/application/resource/FaceletResourceHelper.java
A  +    jsf-ri/src/main/java/com/sun/faces/application/resource/Resource.java
A       jsf-ri/src/main/java/com/sun/faces/application/resource/FaceletResourceInfo.java
D       jsf-ri/src/main/java/com/sun/faces/facelets/util/Resource.java



git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9748 761efcf2-d34d-6b61-9145-99dcacc3edf1
JAVASERVERFACES_SPEC_PUBLIC-949 remove empty comment.

git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9749 761efcf2-d34d-6b61-9145-99dcacc3edf1
Re-enabling tests per Ed's request

git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9750 761efcf2-d34d-6b61-9145-99dcacc3edf1
http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-719


SECTION: Modified Files
----------------------------
M       jsf-api/src/main/java/javax/faces/application/ResourceHandler.java

- More changes coming to this, but for now we declare that the
  ResourceHandler is now used by the VDL.

M       jsf-ri/test/com/sun/faces/application/resource/TestResourceManager.java
M       jsf-ri/test/com/sun/faces/application/resource/TestResourceHandlerImpl.java
M       jsf-ri/test/com/sun/faces/application/resource/TestResourceImpl.java
M       jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultResourceResolver.java
M       jsf-ri/src/main/java/com/sun/faces/application/resource/FaceletResourceHelper.java
M       jsf-ri/src/main/java/com/sun/faces/application/resource/ResourceManager.java
M       jsf-ri/build-tests.xml
M       jsf-ri/systest/web/ajax/ajaxEcho.xhtml
M       jsf-ri/systest/build.xml
A       jsf-ri/src/main/java/com/sun/faces/application/resource/FaceletLibraryInfo.java
A       jsf-ri/web/test/rootLibrary
A       jsf-ri/web/test/rootLibrary/rootLibrary-duke.gif
A       jsf-ri/web/test/root-duke.gif


git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9752 761efcf2-d34d-6b61-9145-99dcacc3edf1
http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-719

SECTION: Modified Files
----------------------------
M       jsf-test/build.xml
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/java
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/java/com
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/java/com/sun
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/java/com/sun/faces
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/java/com/sun/faces/test
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/java/com/sun/faces/test/i_spec_719_old_resource_resolver_war
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/java/com/sun/faces/test/i_spec_719_old_resource_resolver_war/MyResourceResolver.java
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/java/com/sun/faces/test/i_spec_719_old_resource_resolver_war/Resource.java
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/resources
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/webapp
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/webapp/i_spec_719_old_resource_resolver.xhtml
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/webapp/WEB-INF
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/webapp/WEB-INF/beans.xml
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/src/main/webapp/WEB-INF/web.xml
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/i_spec_719_old_resource_resolver_war/pom.xml
A       jsf-test/JAVASERVERFACES_SPEC_PUBLIC-719/build.xml

- Test to assert old FaceletResourceResolver mechanism still works.



git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9753 761efcf2-d34d-6b61-9145-99dcacc3edf1
spellchecker

git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9754 761efcf2-d34d-6b61-9145-99dcacc3edf1
http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-719 http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-809

This commit introduces a cleaner contract for allowing views to be
loaded from the Filesystem (including inside of JAR files).  All VDL
resources must be loaded using ResourceHandler.createViewResource().

Implementation wise, we need to make it so
ResourceHandler.createResource() is above ExternalContext.getResource()
on the callstack in all of these usages:

EB> Usage1: During RestoreViewPhase when trying to load a page to get its
EB> <f:metadata> section.

Done.  

EB> Usage2: When trying to render a button whose action uses conditional
EB> navigation.

Done.

EB> Usage3: When trying to get the viewId on an initial page request.

Done.

EB> Usage4: When trying to serve up a resource request from the filesystem.

Implicitly done.

EB> Usage5: When trying to find a ScriptComponent Resource for a Composite
EB> Component.

Implicitly done.

EB> Usage6: When trying to render out the markup for a stylesheet reference
EB> in the HEAD.

Implicitly done.

SECTION: Modified Files
----------------------------
M       jsf-api/src/main/java/javax/faces/application/ResourceHandler.java
M       jsf-api/src/main/java/javax/faces/application/ResourceHandlerWrapper.java

- Added createViewResource()

M       jsf-api/src/main/java/javax/faces/view/ViewDeclarationLanguage.java

- Specify that the default implementation of viewExists() uses
  ResourceHandler.createResource().

M       jsf-api/src/main/java/javax/faces/view/facelets/FaceletFactory.java
M       jsf-api/src/main/java/javax/faces/view/facelets/FaceletFactoryWrapper.java

- Remove getResourceResolver().

M       jsf-api/src/main/java/javax/faces/view/facelets/ResourceResolver.java

- Deprecate this class.

M       jsf-ri/src/main/java/com/sun/faces/application/view/FaceletViewHandlingStrategy.java

- New implementation of viewExists().

M       jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultFaceletFactory.java
M       jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultResourceResolver.java

- Comments

M       jsf-ri/src/main/java/com/sun/faces/application/resource/ResourceHandlerImpl.java

- in createViewResource(), don't go through the factory, just call
  createResource() direcctly.
Index: jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultFaceletFactory.java
===================================================================
--- jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultFaceletFactory.java	(revision 9751)
+++ jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultFaceletFactory.java	(working copy)
@@ -107,6 +107,9 @@
 
     private Map<String, URL> relativeLocations;
 
+    // We continue to use a ResourceResolver just in case someone
+    // provides a custom one.  The DefaultResourceResolver simply uses
+    // the ResourceHandler to do its work.
     private ResourceResolver resolver;
 
     private  URL baseUrl;
Index: jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultResourceResolver.java
===================================================================
--- jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultResourceResolver.java	(revision 9752)
+++ jsf-ri/src/main/java/com/sun/faces/facelets/impl/DefaultResourceResolver.java	(working copy)
@@ -73,7 +73,7 @@
     }
 
     public URL resolveUrl(String path) {
-        Resource faceletResource = resourceHandler.createResource(path);
+        Resource faceletResource = resourceHandler.createViewResource(path);
         URL result = null;
         if (null != faceletResource) {
             result = faceletResource.getURL();
Index: jsf-ri/src/main/java/com/sun/faces/application/resource/ResourceHandlerImpl.java
===================================================================
--- jsf-ri/src/main/java/com/sun/faces/application/resource/ResourceHandlerImpl.java	(revision 9751)
+++ jsf-ri/src/main/java/com/sun/faces/application/resource/ResourceHandlerImpl.java	(working copy)
@@ -112,6 +112,16 @@
 
     }
 
+    @Override
+    public Resource createViewResource(String resourceName) {
+
+        Util.notNull("resourceName", resourceName);
+
+        return createResource(resourceName, null, null);
+    }
+    
+    
+
     /**
      * @see ResourceHandler#createResourceFromId(String)
      */
Index: jsf-ri/src/main/java/com/sun/faces/application/view/FaceletViewHandlingStrategy.java
===================================================================
--- jsf-ri/src/main/java/com/sun/faces/application/view/FaceletViewHandlingStrategy.java	(revision 9751)
+++ jsf-ri/src/main/java/com/sun/faces/application/view/FaceletViewHandlingStrategy.java	(working copy)
@@ -789,17 +789,13 @@
     @Override
     public boolean viewExists(FacesContext context, 
                               String viewId) {
+        boolean result = false;
         if (handlesViewId(viewId)) {
-            if (faceletFactory == null) {
-                ApplicationAssociate associate = ApplicationAssociate.getInstance(context.getExternalContext());
-                faceletFactory = associate.getFaceletFactory();
-                assert (faceletFactory != null);
-            }
-           
-            return faceletFactory.getResourceResolver().resolveUrl(viewId) != null;
+            ResourceHandler rh = context.getApplication().getResourceHandler();
+            result = null != rh.createViewResource(viewId);
         }
 
-        return false;
+        return result;
     }
 
     @Override 
Index: jsf-api/src/main/java/javax/faces/application/ResourceHandler.java
===================================================================
--- jsf-api/src/main/java/javax/faces/application/ResourceHandler.java	(revision 9752)
+++ jsf-api/src/main/java/javax/faces/application/ResourceHandler.java	(working copy)
@@ -111,6 +111,9 @@
  *  to obtain the encoded URI for the resource.  See {@link
  *  Resource#getRequestPath} and the Standard HTML RenderKit specification for
  *  the complete specification.</p>
+
+ * <p class="changed_added_2_2">This usage of resources does not apply
+ * for resources that correspond to VDL resources.</p>
  *
  * </ul>
  *
@@ -124,7 +127,10 @@
  *  orchestrated by {@link #handleResourceRequest}, which calls {@link
  *  Resource#getInputStream} to obtain bytes of the resource.  See
  *  {@link #handleResourceRequest} for the complete specification.</p>
- *
+
+ * <p class="changed_added_2_2">This usage of resources does not apply
+ * for resources that correspond to VDL resources.</p>
+
  * </ul>
  *
  * </div>
@@ -211,7 +217,40 @@
      * for use in encoding or decoding the named resource.
      */
     public abstract Resource createResource(String resourceName);
+    
+    /**
+     * <p class="changed_added_2_2">Create an instance of <code>Resource</code>
+     * given the argument <code>resourceName</code>, which may contain "/" 
+     * characters.  The {@link javax.faces.view.ViewDeclarationLanguage} calls
+     * this method when it needs to load a view from a persistent store, such as
+     * a filesystem.  This method is functionality equivalent to 
+     * {@link #createResource(java.lang.String)}, but all callsites that need
+     * to load VDL views must use this method so that classes that want to 
+     * decorate the <code>ResourceHandler</code> in order to only affect the
+     * loading of views may do so without affecting the processing of other
+     * kinds of resources, such as scripts and stylesheets.
+     * A {@link javax.faces.context.FacesContext} must be present
+     * before calling this method.  To preserve compatibility with prior revisions of the
+     * specification, a default implementation must be provided that calls
+     * {@link #createResource(java.lang.String)}. </p>
+     * 
+     * @param resourceName the name of the resource to be interpreted as a view
+     * by the {@link javax.faces.view.ViewDeclarationLanguage}.
 
+     * @throws NullPointerException if <code>resourceName</code> is
+     *  <code>null</code>.
+
+     * @return a newly created <code>Resource</code> instance, suitable
+     * for use by the {@link javax.faces.view.ViewDeclarationLanguage}.
+     * 
+     * @since 2.2
+
+     */
+    
+    public Resource createViewResource(String resourceName) {
+        return FacesContext.getCurrentInstance().getApplication().getResourceHandler().createResource(resourceName);
+    }
+
     /**
      * <p class="changed_added_2_2">Create an instance of
      * <code>Resource</code> given the argument
Index: jsf-api/src/main/java/javax/faces/application/ResourceHandlerWrapper.java
===================================================================
--- jsf-api/src/main/java/javax/faces/application/ResourceHandlerWrapper.java	(revision 9751)
+++ jsf-api/src/main/java/javax/faces/application/ResourceHandlerWrapper.java	(working copy)
@@ -91,6 +91,7 @@
      *
      * @since 2.2
      */
+    @Override
     public Resource createResourceFromId(String resourceId) {
 
         return getWrapped().createResourceFromId(resourceId);
@@ -109,7 +110,17 @@
 
     }
 
+    /**
+     * <p class="changed_added_2_2">The default behavior of this method
+     * is to call {@link ResourceHandler#createViewResource(String)} on the wrapped
+     * {@link ResourceHandler} object.</p>
+     */
 
+    @Override
+    public Resource createViewResource(String resourceName) {
+        return getWrapped().createViewResource(resourceName);
+    }
+
     /**
      * <p class="changed_added_2_0">The default behavior of this method
      * is to call {@link ResourceHandler#createResource(String, String,
Index: jsf-api/src/main/java/javax/faces/view/facelets/ResourceResolver.java
===================================================================
--- jsf-api/src/main/java/javax/faces/view/facelets/ResourceResolver.java	(revision 9751)
+++ jsf-api/src/main/java/javax/faces/view/facelets/ResourceResolver.java	(working copy)
@@ -61,7 +61,10 @@
 import java.net.URL;
 
 /**
- * <p class="changed_added_2_0">Provide a hook to decorate or override
+ * <p class="changed_added_2_0"><span class="changed_deleted_2_2">Deprecated as 
+ * of JSF 2.2.  The same functionality is more correctly provided by
+ * {@link javax.faces.application.ResourceHandler}.</span> Provide
+ * a hook to decorate or override
  * the way that Facelets loads template files.  A default implementation
  * must be provided that satisfies the requirements for loading
  * templates as in Pre-JSF 2.0 Facelets.</p>
@@ -87,6 +90,7 @@
 
  */
 
+@Deprecated
 public abstract class ResourceResolver {
 
     public static final String FACELETS_RESOURCE_RESOLVER_PARAM_NAME = 
Index: jsf-api/src/main/java/javax/faces/view/facelets/FaceletFactory.java
===================================================================
--- jsf-api/src/main/java/javax/faces/view/facelets/FaceletFactory.java	(revision 9751)
+++ jsf-api/src/main/java/javax/faces/view/facelets/FaceletFactory.java	(working copy)
@@ -85,8 +85,6 @@
 
     public abstract Facelet getMetadataFacelet(URL url) throws IOException;
 
-    public abstract ResourceResolver getResourceResolver();
-
     public abstract long getRefreshPeriod();
 
 }
Index: jsf-api/src/main/java/javax/faces/view/facelets/FaceletFactoryWrapper.java
===================================================================
--- jsf-api/src/main/java/javax/faces/view/facelets/FaceletFactoryWrapper.java	(revision 9751)
+++ jsf-api/src/main/java/javax/faces/view/facelets/FaceletFactoryWrapper.java	(working copy)
@@ -100,12 +100,5 @@
     public long getRefreshPeriod() {
         return getWrapped().getRefreshPeriod();
     }
-
-    @Override
-    public ResourceResolver getResourceResolver() {
-        return getWrapped().getResourceResolver();
-    }
     
-    
-    
 }
Index: jsf-api/src/main/java/javax/faces/view/ViewDeclarationLanguage.java
===================================================================
--- jsf-api/src/main/java/javax/faces/view/ViewDeclarationLanguage.java	(revision 9751)
+++ jsf-api/src/main/java/javax/faces/view/ViewDeclarationLanguage.java	(working copy)
@@ -42,18 +42,17 @@
 
 import java.beans.BeanInfo;
 import java.io.IOException;
-import java.net.MalformedURLException;
 import java.util.List;
-import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 
 /**
  * <p class="changed_added_2_0"><span class="changed_modified_2_0_rev_a
- * changed_modified_2_1">The</span> contract that a view declaration
+ * changed_modified_2_1 changed_modified_2_2">The</span> contract that a view declaration
  * language must implement to interact with the JSF runtime.  An
  * implementation of this class must be thread-safe.</p>
  *
@@ -541,12 +540,13 @@
 
 
     /**
-     * <p class="changed_added_2_1">Tests whether a physical resource
+     * <p class="changed_added_2_1"><span class="changed_modified_2_2">Tests</span>
+     * whether a physical resource
      * corresponding to the specified viewId exists.</p>
      *
-     * <p>The default implementation uses 
-     * <code>ExternalContext.getResource()</code> to locate the physical
-     * resource.</p>
+     * <p class="changed_modified_2_2">The default implementation uses 
+     * {@link javax.faces.application.ResourceHandler#createViewResource(java.lang.String)}
+     * to locate the physical resource.</p>
      *
      * @param context The <code>FacesContext</code> for this request.
      * @param viewId the view id to test
@@ -555,17 +555,11 @@
      */    
     public boolean viewExists(FacesContext context, 
                               String viewId) {
-       try {
-           return context.getExternalContext().getResource(viewId) != null;
-       } catch (MalformedURLException e) {
-           if (LOGGER.isLoggable(Level.SEVERE)) {
-               LOGGER.log(Level.SEVERE,
-                          e.toString(),
-                          e);
-           }
-       }
+        boolean result = false;
+        ResourceHandler rh = context.getApplication().getResourceHandler();
+        result = null != rh.createViewResource(viewId);
 
-       return false;
+        return result;
     }
 
     /**


git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9755 761efcf2-d34d-6b61-9145-99dcacc3edf1

<< http://java.net/jira/browse/JAVASERVERFACES-2336 >>


SECTION: Modified Files
----------------------------
M       jsf-ri/src/main/java/com/sun/faces/facelets/util/Classpath.java
---- Remove setDefaultUseCaches(false)
---- The method in this ckass still calls setUseCaches(false) which will apply to the
---- current URLConnection (not all URLConnections).
M       jsf-test/build.xml
---- Added test case.

A       jsf-test/JAVASERVERFACES-2336
A       jsf-test/JAVASERVERFACES-2336/htmlunit
A       jsf-test/JAVASERVERFACES-2336/htmlunit/src
A       jsf-test/JAVASERVERFACES-2336/htmlunit/src/main
A       jsf-test/JAVASERVERFACES-2336/htmlunit/src/main/java
A       jsf-test/JAVASERVERFACES-2336/htmlunit/src/main/java/com
A       jsf-test/JAVASERVERFACES-2336/htmlunit/src/main/java/com/sun
A       jsf-test/JAVASERVERFACES-2336/htmlunit/src/main/java/com/sun/faces
A       jsf-test/JAVASERVERFACES-2336/htmlunit/src/main/java/com/sun/faces/systest
A       jsf-test/JAVASERVERFACES-2336/htmlunit/src/main/java/com/sun/faces/systest/Issue2336TestCase.java
A       jsf-test/JAVASERVERFACES-2336/htmlunit/pom.xml
A       jsf-test/JAVASERVERFACES-2336/i_jsf_2336
A       jsf-test/JAVASERVERFACES-2336/i_jsf_2336/src
A       jsf-test/JAVASERVERFACES-2336/i_jsf_2336/src/main
A       jsf-test/JAVASERVERFACES-2336/i_jsf_2336/src/main/java
A       jsf-test/JAVASERVERFACES-2336/i_jsf_2336/src/main/java/i_jsf_2336
A       jsf-test/JAVASERVERFACES-2336/i_jsf_2336/src/main/java/i_jsf_2336/TestBean.java
A       jsf-test/JAVASERVERFACES-2336/i_jsf_2336/src/main/Main1.iml
A       jsf-test/JAVASERVERFACES-2336/i_jsf_2336/src/main/webapp
A       jsf-test/JAVASERVERFACES-2336/i_jsf_2336/src/main/webapp/WEB-INF
A       jsf-test/JAVASERVERFACES-2336/i_jsf_2336/src/main/webapp/WEB-INF/web.xml
A       jsf-test/JAVASERVERFACES-2336/i_jsf_2336/src/main/webapp/UseCacheTest.xhtml
A       jsf-test/JAVASERVERFACES-2336/i_jsf_2336/pom.xml
A       jsf-test/JAVASERVERFACES-2336/build.xml
---- New Test Module.
---- The managed bean will open a URLConnection and test that URLConnection.getUseCaches
---- and URLConnection.getDefaultUseCaches does not return false.


git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9756 761efcf2-d34d-6b61-9145-99dcacc3edf1
remove JAVASERVERFACES-2336 as it does not execute as expected

git-svn-id: https://svn.java.net/svn/mojarra~svn/trunk@9761 761efcf2-d34d-6b61-9145-99dcacc3edf1