struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <martin.coo...@tumbleweed.com>
Subject Re: some comparision between JSP/struts and velocity
Date Wed, 01 Aug 2001 21:07:41 GMT
One thing to consider here is the partitioning of functionality across tag
libraries. For example, Struts currently has four taglibs - bean, html,
logic and template. The tags in the html taglib are the only ones that
generate HTML. This was a deliberate design decision, and allows the
remaining taglibs to be reused in non-HTML situations.

On the ToDo list for Struts 1.1 is a WML taglib. Once that exists, people
will be able to create HTML output using the html taglib, or WML output with
the wml taglib, and in either case they can continue to use the tags from
the bean, logic and template taglibs.

I don't think it's a question of whether or not generating HTML from custom
tags is a "bad thing". It's more a case of ensuring that the tags - and more
specifically the tag libraries - are well designed for their intended
purpose.

--
Martin Cooper


----- Original Message -----
From: "Assenza, Chris" <cassenza@Accessdc.com>
To: <struts-user@jakarta.apache.org>
Sent: Tuesday, July 31, 2001 6:28 AM
Subject: RE: some comparision between JSP/struts and velocity


> I tend to agree with Tim here, but only in certain circumstances.  If you
> place very specific HTML code in your tag library then that tag library
has
> become very restricted in its use - basically it can only be used in the
> original context for which it was designed, otherwise the HTML will
probably
> not match up properly.  That makes re-using your taglibs pretty difficult,
> at least without re-writing the HTML within each time.
>
> On the other hand, if you don't care about cross-project reusability, then
> embedding HTML into a tag isn't such a bad idea since you only care about
it
> for the current project and current needs. Personally, I think it's ideal
to
> generate the minimalist amount of generic HTML as possible in a tag and
then
> wrap it in HTML on the JSP when you use the tag.  Again, that's only if
> you're going for maximum reusability.  Right now, I've got some HTML
> embedded in our tags, but it's very generic HTML that can be used again
and
> again without much actual change to the Java code itself. :)
>
> -Chris
>
>
> -----Original Message-----
> From: Tim Colson [mailto:tcolson@cisco.com]
> Sent: Monday, July 30, 2001 9:20 PM
> To: struts-user@jakarta.apache.org
> Subject: RE: some comparision between JSP/struts and velocity
>
>
> > Niall Pemberton suggested
> > ...if the Struts tags dont do what you want then write your
> > own. Then you dont have to use scriptlets, you have a re-useable bit of
> > functionality, the web designers are happy and you dont have to use
> > Velocity.
> While a custom tag is an option; this bit of functionality would have
> required embedding  javascript code and html inside the custom tag lib. To
> me, putting view specific code like inside a tag library is also a
slippery
> slope in the quest to keep thing separated.
>
> Cheers,
> Timothy
>



Mime
View raw message