[jboss-user] [JBoss Seam] - Yeah!

atleprange do-not-reply at jboss.com
Wed Apr 18 16:55:26 EDT 2007

This looks excellent!

I used a different approach. I modified the seam antlr grammer so it would recognize the macros, and replaced it with a home made injection tag (<wiki:inject name="macroname" factory="wiki.macroname('param1','param2')" />)

I then run the facelet compiler over the content, leaving it to create the components. The inject tag works just as a normal UI:include: It includes a facelet with the same name as the macro, but it additionaly calls a factory method on a seam component named 'wiki.', which creates a java bean that is then passed to the included facelet. That way i can have a different bean for each macro, based on the params the user supplies. (The params are supplied to the factory as strings)

My approach has several obvious downsides:
Compiling the text every time is time consuming
No form submits, since the components disappear after they have been rendered (i think)

The pros: I can back every macro with a bean, which is created based on macro parameters.

Next i am thinking of implementing markers, that can give text some semantic meaning that is a bit more advanced than the normal tags.

The beauty of seam is that it just makes it so easy to implement!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4038636#4038636

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4038636

More information about the jboss-user mailing list