dev@jsftemplating.java.net

Re: JSFTemplating: Re: Problem using Component

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Fri, 21 Mar 2008 01:06:33 -0700

Hi Jason,

Sorry for the delayed reply... trying to do more work and less email.  My inbox is rebelling, however.

Anyway, wrt, # of jar files... if we have the standard (h:/f:) components supported in the core jar + facelets taglib.xml support.  Then they only need 1 jar.  If they want to add woodstock or other component libraries, they can either: 1) add a facelets taglib.xml (which is typically already done by virtue of using the component library); or 2) add a 2nd jar file w/ factories.  In addition to disk space, factories get loaded into memory (they're small)... but there's no need to have support for comonents you know you'll never use.

A component-only jar file is fine as well since this can be added by the component developer.  It might be nice to make it easy to "embed" or even change package names to avoid naming conflicts... or better yet, allow compile-time code-gen so there is no JSFT dependency even though the src file uses it.  All this will likely become moot with JSF 2.0, though.

Supporting interoperability with JSP and Facelets is a must have.  If pulling out the viewhandler from the jsft.jar file means it is difficult to define multiple view handlers (or even confusing), I don't want to do that.  I think there are 2 types of users that use JSFT: page authors; and component authors.  If you're a page author, you need the ViewHandler.  If you're a component author, you should know what you're doing well enough to do the right thing.  There's a 3rd (smaller) group that might want pageSession, fileStreamer, etc... if that group gets bigger I might change my opinion on where the ViewHandler declaration belongs.

The "handlers" I referred to are the Facelets taglib.xml "handler-class" references.  Such as:

<facelet-taglib>
  <namespace>https://ajax4jsf.dev.java.net/ajax</namespace>
  <tag>
    <tag-name>ajaxListener</tag-name>
    <handler-class>
        org.ajax4jsf.tag.AjaxListenerHandler
    </handler-class>

  </tag>
  <tag>
    <tag-name>facet</tag-name>
    <handler-class>
        org.ajax4jsf.tag.FacetHandler
    </handler-class>

...


Although these require a specific Facelets interface, I think there are a few ways we can make this work.

Ken

Jason Lee wrote:
Ken Paulsen wrote:
Q: Can you provide 2 view handler declarations in the same faces-config.xml file?

I don't know. :)

I'm not 100% against it, but I would rather not for the same reason you don't want to make your users add a phase listener for your components.  It should "just work".

Yeah, I see your point, but, fwiw, that's how Facelets does it.  hehe. I might be easier to put the ViewHandler decl in than requiring users to download 13 jars.  Well, 2, but... :P

You mean as is done today?  No it doesn't hurt much... they are small.

I thought the difference would mostly be psychological.  This would allow people to include only the ones they want, and would demonstrate how to add support for JSFT so that this content could be moved to the correct place (the component libraries themselves).  And in some cases, size does matter... so cutting out 50K (or maybe it's more?  I don't know), may be worth while.

The cost may an semi-uncontrolled proliferation of jars though.  It should just work... ;)

Yep... perhaps we can also talk about better taglib.xml support...

Meaning?  Is that long the lines of the getJarResources() method?

naming the "handlers" that facelets declares.  Perhaps we can do

Handlers?