-
JSFTemplating and Woodstock: Component Authoring Made Easy (3 messages)
- Posted by: Joseph Ottinger
- Posted on: January 02 2008 10:59 EST
java.sun.com has posted a new article, "JSFTemplating and Woodstock: Component Authoring Made Easy" by Ken Paulsen, Jason Lee and Rick Palkovic. The article shows how to use the JSFTemplating and Woodstock projects to make JSF components with only two files: a .java sourcefile (with annotations) and an .xhtml template. In addition to providing a much (much) easier way to write JSF components, this technique is likely to become part of JSF 2.0, which has ease of component development as a high priority.Threaded Messages (3)
- Starting to look more like Tapestry by Nathan Kopp on January 02 2008 16:46 EST
- Good road by Werner Punz on January 03 2008 12:53 EST
- Re: Good road by Ken Paulsen on January 08 2008 01:33 EST
- Good road by Werner Punz on January 03 2008 12:53 EST
-
Starting to look more like Tapestry[ Go to top ]
- Posted by: Nathan Kopp
- Posted on: January 02 2008 16:46 EST
- in response to Joseph Ottinger
Finally JSF component creation is beginning to look a bit more like Tapestry. ;-) Still seems a bit clunky in a few places. For example, there are a lot of calls to "getPropertyValue" (in each of the getters) and some pretty hideous and error-prone code for "saveState" and "restoreState" in the UIComponent. I would think that all of those operations could be handled automatically by the framework (using the @Property and maybe other annotations as hints). -
Good road[ Go to top ]
- Posted by: Werner Punz
- Posted on: January 03 2008 12:53 EST
- in response to Nathan Kopp
I think they are on an excellent road with this. I agree with the poster before me, the save and restore state and the setter and getter logic should be hidden via annotations. But definitely they got many things right this time one controller -> the component one renderer -> in a templating language I just wonder how to implement components with childelements with this approach, probably there is a helper function which triggers some child render code. -
Re: Good road[ Go to top ]
- Posted by: Ken Paulsen
- Posted on: January 08 2008 13:33 EST
- in response to Werner Punz
I just wonder how to implement components with childelements with this approach, probably there is a helper function which triggers some child render code.
In this implementation, child elements (components) are declared just as you would declare them in a page: If you meant, how do you render the user-specified children... you are correct, you can either render the child element by id: (the id can be an expression, btw). Or you can iterate through the children and render them as shown in the previous TSS article, also shown in project Scales (look at renderChildren.jsf): https://scales.dev.java.net/source/browse/scales/trunk/sources/src/resources/templates/ This could still be optimized more... Scales gets around this by using a "ui:include" in each file that wants to render all its children.