jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Nielsen <gl...@voyager.apg.more.net>
Subject [Fwd: Re: <session:setattribute>]
Date Fri, 08 Dec 2000 21:29:49 GMT

Mike Cannon-Brookes wrote:
> Am I right in thinking that this tag can only set String attributes?


> Surely this is artificially limiting the usefulness of this tag?
> How about adding an optional value attribute:
> <session:setattribute name="foo" value="<%= bar %>" />
> This way you could set objects as well as just Strings?

Yes, this is limiting.  Here is my reasoning behind the design.

I see JSP tags as something web publishers will use in web publishing
tools.  Not programmers.  You may have noticed that none of the tags
I have written allow an attribute to be set using a runtime expression
value <rtexprvalue>.  This is a design choice I made.  Allowing <rtexprvalue>
requires that the page author enter a scriptlet of java code.  This
starts taking the tag set out of the realm where it can easily be used
by web publishers using web publishing tools.

If a web author is using only jsp tag libraries, then some other tag
that generates an object should be responsible for saving it as session
information.  Or the object they need to use could be a JSP bean, where
you can specify the session scope.



Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |

View raw message