Need method to map viewId to resource path #719
Comments
Reported by daschneider |
Issue-Links: |
@edburns said: |
@edburns said: |
@edburns said: |
sheetalv said: |
@edburns said: |
@edburns said: |
@edburns said: |
@edburns said: |
@edburns said: |
@edburns said: |
@edburns said: Here are the usages that I have discovered thus far: Usage1: During RestoreViewPhase when trying to load a page to get its Usage2: When trying to render a button whose action uses conditional Usage3: When trying to get the viewId on an initial page request. Usage4: When trying to serve up a resource request from the filesystem. Usage5: When trying to find a ScriptComponent Resource for a Composite Usage6: When trying to render out the markup for a stylesheet reference There may be others, possibly from the application space as well. Both 719 and 809 want some kind of API to allow loading resources. |
@edburns said: |
File: 20120307-0002-i_spec_719_snapshot.patch |
@edburns said: |
File: 20120309-0034-i_spec_719.patch |
@edburns said: |
@edburns said: |
File: changebundle.txt |
@edburns said: |
dougd said: The code that appears to be causing the failures is below. What it looks like to me is that if toStream is not an instanceof ClientResourceInfo we just end up going off into the weeds. public InputStream getInputStream(ResourceInfo toStream, FacesContext ctx) // PENDING(edburns): this is a sub-optimal implementation choice InputStream in = null; if (toStream instanceof ClientResourceInfo) { in = getInputStreamFromClientInfo(resource, ctx); { resource.copy(resourceWithoutLocalePrefix); } } } else { // PENDING(edburns): get the input stream from the facelet ResourceInfo. <------- "Offending Code" } return in; } |
@edburns said: SECTION: 1085 changesM jsf-api/src/main/java/javax/faces/context/ExternalContext.java
M jsf-ri/src/main/java/com/sun/faces/context/ExternalContextImpl.java
A test/agnostic/externalContext
SECTION: 719 changesM jsf-ri/src/main/java/com/sun/faces/application/resource/ClasspathResourceHelper.java
SECTION: Build changesM jsf-ri/systest/build-tests.xml
This reduces the test count by two on the old side, but increases it M test/agnostic/pom.xml
M test/pom.xml
SECTION: 730 changes M jsf-api/src/main/java/javax/faces/flow/Flow.java
Sending jsf-api/src/main/java/javax/faces/context/ExternalContext.java |
rogerk said: |
rogerk said: |
@edburns said: |
Marked as fixed on Thursday, November 1st 2012, 2:40:41 pm |
This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-719 |
The current JSF specification does not provide a standard plugable mechanism for
mapping a viewId to the resource path for the resource that will render the
view. Although the specification doesn't state that the requested viewId be
literally the resource path of the VDL document some parts of the RI assume this
with code similar to:
String viewId = FacesContext.getViewRoot().getViewId();
Object resource = externalContext.getResource(viewId);
This breaks applications that want to have some type of indirection or mapping
between viewIds and physical resources (e.g. viewId "/x/y/z" is rendered using
document "/a/b/foo.jspx").
Apache Trinidad solves this problem with a plugable interface called a
PageResolver (see
http://myfaces.apache.org/trinidad/trinidad-api/apidocs/index.html). This may
server as an model for how to provide this capability in the standard.
Environment
Operating System: All
Platform: All
Affected Versions
[2.0]
The text was updated successfully, but these errors were encountered: