You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tom Morris <to...@rubus.com> on 2001/11/19 18:34:38 UTC
HTML Link Tags Seem Clumsy
Hello there,
I'm starting to use Struts and was wondering If I'm correct in thinking
that it's a little inflexible when it comes to choosing datatypes for
form-bean properties.
Displaying a query-parameter based HREF link is annoying since, it only
accepts String types.
It would be nice to model my beans in their true form, and have Struts apply
'toString()'
on all non-String data. For example I can't have Integer form-bean
properties participate
in a 'html:link' tag.
Am I missing some fundamental Struts design decision?
Building 'html:link' tags seems particularly awkward when parameters are
required.
The Map approach seems ugly since it requires an extra method on every bean
which
goes through a population process on some object that implements 'Map'.
Why was the tag-lib attribute interface not extended in some way?
I was going to post this to the dev-list, but felt that I must have the
wrong end-of-the stick.
Many thanks for your help (and understanding...)
-Tom
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: HTML Link Tags Seem Clumsy
Posted by Ted Husted <hu...@apache.org>.
Tom Morris wrote:
> I'm starting to use Struts and was wondering If I'm correct in thinking
> that it's a little inflexible when it comes to choosing datatypes for
> form-bean properties.
>
> Displaying a query-parameter based HREF link is annoying since, it only
> accepts String types.
> It would be nice to model my beans in their true form, and have Struts apply
> 'toString()'
> on all non-String data. For example I can't have Integer form-bean
> properties participate
> in a 'html:link' tag.
>
> Am I missing some fundamental Struts design decision?
You may be mixing design decisions. The link tag is in the html taglib,
but isn't coupled with the html:form tag, like most of the others. Using
only Strings and booleans in ActionForms is a separate issue. Most
often, html:link is used with beans other than ActionForm beans.
html:link does apply toString() to properties, just as the bean tags do,
and I often use it with Integer properties. The properties just aren't
stored on ActionForm beans, which have a very narrow purpose.
> Building 'html:link' tags seems particularly awkward when parameters are
> required.
> The Map approach seems ugly since it requires an extra method on every bean
> which
> goes through a population process on some object that implements 'Map'.
> Why was the tag-lib attribute interface not extended in some way?
What did you have in mind?
> I was going to post this to the dev-list, but felt that I must have the
> wrong end-of-the stick.
>
> Many thanks for your help (and understanding...)
>
> -Tom
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>