Re: h:link not rendered

Splash Forums PrettyFaces Users h:link not rendered Re: h:link not rendered


Hey, you a completely correct. I didn’t read the javadocs correctly, sorry.

Thanks for all this digging. However, I don’t think that PrettyFaces is the correct place to fix this. IMHO the JSF implementation (which is Mojarra in your case) behaves not correctly here. The spec speaks of “look for a physical resource with that name”. But Facelets allows to load resources from different places, as you are doing it. So Mojarra doesn’t correctly check the physical existence of the resource if it just uses getExternalContext().getResource(viewId) for the check.

I had a quick look at the MyFaces 2.1 source. It looks like they are doing it differently. They are checking the existence of the resource using something like this:

context.getApplication().getViewHandler().getViewDeclarationLanguage(context, viewId).viewExists(context, viewId);

I think this should work fine even in your case, because the Facelets VDL implementation will answer the question whether the view exists or not. And I guess they will correctly use your ResourceResolver. So for me this really looks like a Mojarra or a spec bug.

Actually I think by implementing a custom ViewHandler that fixes the result of Mojarra’s implementation of deriveViewId() you are going the correct way for your project. I would have done it exactly like this. :)