You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Daniel LaLiberte <li...@hypernews.org> on 2004/09/22 04:17:41 UTC

Parameterized include taglib

I have developed a set of three tags to provide a parameterized include (or template) mechanism that is essentially an extension of the struts bean taglib.  

(Overview)

* The include tag specifies a file to be included (like the bean include tag).  

* The param tag allows named parameters to be given values, which may come from a name attribute (referencing a JSP bean), a value attribute, or JSP content.

* The getParam tag, used in the included file, specifies which named parameters to import into page attributes, and what their default values are. 

* Normal bean:write tags are used to access the parameters in page attributes.

(Motivation)

I am aware of many other include and template mechanisms, but none of them do quite what I want.  The main unique feature of this taglib is that the parameters of the include may be given values from the JSP content of the param tag.  This allows much easier composition of pages than the alternatives.  Only XSL's named templates have the equivalent power.  I have an in-depth writeup of the requirements and design that I would be happy to share with anyone interested. 

(Requirements)

This taglib doesn't require much (probably any JSP/Java) but it effectively requires use of the struts bean tags (particularly bean:write).

(Commitment)

We have used these tags at work (ProfitLogic) for almost two years, allowing us to factor out all common HTML into template files.  I have been given permission to release this work, with the hope that Apache struts (or Jakarta?) will adopt it.   There is more work that logically should be done, but we did not need to do more for ourselves.

I'd suggest that these tags should be incorporated into an existing taglib because it is such a small set on its own, and it fits in stylistically with the bean and logic taglibs.  I don't expect I would be a very active contributor to the taglibs-dev outside of my interest in getting this taglib adopted in some form.

Please let me know if you are interested.

Daniel LaLiberte
liberte@hypernews.org

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org


Re: Parameterized include taglib

Posted by Daniel LaLiberte <li...@hypernews.org>.
I found the following question at http://struts.apache.org/faqs/kickstart.html#taglibs

  Why aren't the Struts tags maintained as part of the Jakarta Taglibs project?

The Jakarta Tabligs pages should probably reference that page, because folks like me will naturally gravitate to the Jakarta Taglibs.

The answer suggests that if I want to have my include tag incorporated into the Struts bean taglib, I'll have to work with the Struts team.  Another possibility, by the way, is to modify the Tiles taglib, but again, Struts folks are doing that.

In any case, I published the document I referred to at http://www.hypernews.org/IncludeTag.html

Daniel LaLiberte wrote:
> Please let me know if you are interested.
> 
> Daniel LaLiberte
> liberte@hypernews.org


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org