Hi Martin<br><br>Yes, this one was settled on JSF 2.1 in this way:<br><br>1. Add this method to ViewHandler.<br><br>String deriveLogicalViewId(FacesContext context, String rawViewId) <br><br>2. Fix ViewHandler.getViewDeclarationLanguage(FacesContext context, String viewId) method javador to specify the viewId to be used is the one after call deriveLogicalViewId<br>
<br>It was solved under this topic:<br><br>[jsr-314-open] 490-XmlViews Processing JSPX files as Facelets<br><br>best regards,<br><br>Leonardo Uribe<br><br><div class="gmail_quote">2011/2/7 Martin Marinschek <span dir="ltr"><<a href="mailto:mmarinschek@apache.org">mmarinschek@apache.org</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Leonardo,<br>
<br>
was this ever settled? Did you get the feedback you need? Did you open an issue?<br>
<br>
best regards,<br>
<br>
Martin<br>
<div><div></div><div class="h5"><br>
On Tue, Sep 14, 2010 at 3:30 AM, Leonardo Uribe <<a href="mailto:lu4242@gmail.com">lu4242@gmail.com</a>> wrote:<br>
> Hi<br>
><br>
> The current algorithm to check if a view with a specific viewId does not<br>
> allow to add or extends a new ViewDeclarationLanguage using a new<br>
> prefix/extension.<br>
><br>
> This issue is related to<br>
><br>
> <a href="https://issues.apache.org/jira/browse/MYFACES-2628" target="_blank">https://issues.apache.org/jira/browse/MYFACES-2628</a> Facelets ResourceSolver<br>
> can't work<br>
><br>
> and<br>
><br>
> <a href="https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1567" target="_blank">https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1567</a><br>
><br>
> The problem resides on a "hidden" requeriment for Restore View Phase<br>
> algorithm, that is ignored silently. On mojarra, this is the code on<br>
> MultiViewHandler.getViewDeclarationLanguage:<br>
><br>
> public ViewDeclarationLanguage getViewDeclarationLanguage(FacesContext<br>
> context,<br>
> String viewId)<br>
> {<br>
><br>
> String actualViewId = derivePhysicalViewId(context, viewId, false);<br>
> return vdlFactory.getViewDeclarationLanguage(actualViewId);<br>
><br>
> }<br>
><br>
> Now on myfaces is this:<br>
><br>
> @Override<br>
> public ViewDeclarationLanguage getViewDeclarationLanguage(<br>
> FacesContext context, String viewId)<br>
> {<br>
> // return a suitable ViewDeclarationLanguage implementation for the<br>
> given viewId<br>
> return _vdlFactory.getViewDeclarationLanguage(viewId);<br>
> }<br>
><br>
> The difference is subtle, but very, very important. This method is called<br>
> from many locations, but only once (from RestoreViewPhase) it is passed the<br>
> "raw" viewId. To "derive" the physical viewId it is required to know if<br>
> prefix or suffix mapping is used and if suffix mapping is used, try to check<br>
> if a view "resource" exists or not with different derived ids with the<br>
> extensions configured ".xhtml .jsp".<br>
><br>
> javax.faces.view.facelets.ResourceResolver documentation says this:<br>
><br>
> "... Provide a hook to decorate or override the way that Facelets loads<br>
> template files. A default implementation must be provided that satisfies the<br>
> requirements for loading templates as in Pre-JSF 2.0 Facelets ..."<br>
><br>
> So, in theory it is possible to override ResourceResolver interface and<br>
> serve resources from a different location. But the algorithm in<br>
> MultiViewHandler.derivePhysicalViewId does not take into account this<br>
> interface, so it try to check if the view "resource" exists on the same<br>
> location and fails.<br>
><br>
> The solution proposed is add a method on ViewHandler,<br>
> ViewDeclarationLanguageFactory and ViewDeclarationLanguage called:<br>
><br>
> public boolean existsViewId(String viewId)<br>
><br>
> So the VDL can indicate if a viewId exists or not. In this way, on Facelets<br>
> VDL we can check if a viewId exists using the ResourceResolver instance. It<br>
> is curious that ViewDeclarationFactory implementation has some methods that<br>
> indicate if a vdl can handle a viewId or not (it is not the same, but<br>
> similar). I'm not done too much work on this issue, but it could be good to<br>
> take a look at this one. It could be good to open an issue on the spec for<br>
> this one too (if no objections I'll open an issue for this one, but better<br>
> to ask first).<br>
><br>
> Suggestions are welcome.<br>
><br>
> regards,<br>
><br>
> Leonardo Uribe<br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<br>
<a href="http://www.irian.at" target="_blank">http://www.irian.at</a><br>
<br>
Your JSF powerhouse -<br>
JSF Consulting, Development and<br>
Courses in English and German<br>
<br>
Professional Support for Apache MyFaces<br>
</blockquote></div><br>