Thanks Ted & TomK,

As a beginer, I'd better think about what you have both said for a while.

However:

I'm not mixing-up the differences between forms and links,
but we're experiencing the absence of integer parameters on a link
but no problems with strings.
Briefly: we have a FormBean containing a value-object, which has an integer
property.
I didn't think there were restrictions on the nested-property types.

I'll double-double check that we have no coding error.

As for the multiple parameters on link:
I noticed a number of struts-projects using the 'form:' tags to submit
parameters
to other actions. (Note: these tags are extended so that hyperlinks can
control
a javascript form submission.). This is simply to ease making a multi-param
http
request. (I suppose froms can be made to GET instead of POST...)

Do you think it would be a worthwhile change to the already lovely Struts,
to do something like the follwing?

<html:link href="/myproj/myaction.do">
<html:linkparam paramId="uid" paramName="myBean" paramProperty="myId" />
<html:linkparam paramId="name" paramName="myBean" paramProperty="myName" />
Click Me
</html:link>

I guess the 'html:linkparam' can use 'getParentTag' and use an 'addGetParam'
(or something) adding values to populate a growing HashMap.

I'm pretty sure the TLD doesn't need to be anything speical.
(I've created nested TagLibs before and don't remember anything difficult).
Just make sure that = "<bodycontent>JSP</bodycontent>"


Or these simple notations (hacky & inelegant & limited):

<html:link href="/myproj/myaction.do"
getParams="uid,myBean,myId|name,myBean,myName" >
Click Me
</html:link>

OR

<html:link href="/myproj/myaction.do"
getParams="uid,myBean,myId|name,myBean,myName" >
Click Me
</html:link>

Many thanks for you comments,
TomM

-----Original Message-----
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: 20 November 2001 10:19
To: Struts Users Mailing List
Subject: Re: HTML Link Tags Seem Clumsy


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:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to