struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: IterateTag Enhancement: Specify Collection Explicitly
Date Sun, 02 Jul 2000 19:41:07 GMT
David Geary wrote:

> Marius Sorin Barduta wrote:
>
> > > David Geary wrote:
> >  > I object to being forced to store a collection in a servlet scope just so
> > that I
> > > can iterate over it. Iteration should work on all beans, regardless of
> > where they
> > > are stored.
> >
> > Well, if one doesn't create the bean outside the JSP page (for example in an
> > Action) one may create it in the JSP page itself. It's ok with this approach
> > but IMHO this goes a little against one of the proposed goals for Struts
> > framework, that is to separate the business logic from the presentation as
> > much as possible. So, why not force struts users in a better programming
> > habit than that they are used to?
> > :-)
>
> Because the tag does not force Struts users to do anything. A business logic
> collection can still be created in a JSP page, put in session scope, and
> iterated over.
>
> The problem here, as far as I see it, is that a tag named IterateTag should
> provide the ability to iterate over any bean, not just those stored in a servlet
> scope. If it doesn't, it should be called something other than an iterator
> (IterateOverBeansInScopeTag.java?)
>

So how does one create a bean that is not in some scope (page, request, session, or
application)?  The only way I can think of is using a scriptlet, which is *not* a
programming practice that I'm a fan of.

As David points out, it's an easy addition to the iterate tag to support this
capability.  I will look at it further.


>
> david

Craig



Mime
View raw message