jsr344-experts@javaserverfaces-spec-public.java.net

[jsr344-experts] [1142-Contracts] False positives, are they a problem?

From: Edward Burns <edward.burns_at_oracle.com>
Date: Fri, 16 Nov 2012 13:29:35 -0800

Hello Volunteers,

I've made a permalink to the latest spec snapshot javadocs. No more
having to go through the nexus UI.

If the hudson jobs complete successfully, this gives you the absolute
latest spec, updated nightly.

http://jsf-spec.java.net/SNAPSHOT/javadoc/

Considering that link, look at the JavaDoc for
ResourceHandler.createViewResource(). I added this as a PENDING comment
because I need an answer here, probably from Frank.

PENDING(edburns): I think we need to put an additional check in to avoid
returning false hits from this method when a viewResource happens to be
named the same as one of the templates in a resource library
contract. Perhaps we could set some kind of flag in the tag handler of
all facelet tags that are valid for using resource library contracts
(maybe just ui:composition and ui:decorate) and make it so the
getResourceLibraryContracts part of this method only takes effect if
that flag is set?

Consider this scenario.

webapp/
      contracts/
               siteLayout/
                         fozzy.xhtml
      page1.xhtml
      fozzy.xhtml

Assume siteLayout applies to the entire site.

When you try to load <http://host/webapp/faces/fozzy.xhtml>

I think the one from siteLayout will be picked up, and obviously that's
not correct.

To fix this, I think we should make it so the contract lookup mechanism
is only honored if we are processing ui:composition or ui:decorate.

What do you think?

Ed


-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| homepage:               | http://ridingthecrest.com/