Jurgen Lust schrieb:
Hi,

I think most people will agree that writing Renderers for JSF components
using the standard tools, i.e. ResponseWriter.startElement and
ResponseWriter.writeAttribute etc., is not very straightforward or
productive, especially when creating complex components. If you take a
look at org.apache.myfaces.custom.schedule.ScheduleDetailedDayRenderer,
you'll know what I mean :)

One of the great things about Dojo is that you can create templates for
your components. Inspired by this, I tried to do something similar for
JSF renderers, using Freemarker. I put it in the sandbox, and wrote a
replacement HtmlOutputTextRenderer based on it. I know the outputText is
a bad example for this, but for complex stuff, this could be really
useful.

What do you think?

Jurgen

Actually Sorin is working on it as reported.

As I said before this would be heavens sent, the renderer part of the components really should be on the markup not vice versa.

The main problem I see if you do something like that is that you probably have to do it in the context of a page, request or session singleton on component level it would be a huge speed hit, on the other hand if you can do it on page/session or application level you even could gain speed due to the caching those engines do.

(They work very similarily in the way that they build and compile a tree and do the caching within the tree) I have seen things done in velocity (and freemarker is pretty similar) on pagelevel which outperform pure jsp by miles.

The main issue is on the renderer side, you have to push into the template:

a) your component object
b) a set of tools classes every component should be able to access, which provided some services

Reply via email to