You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Sweeney <ri...@hotmail.com> on 2002/04/11 13:41:08 UTC

Multiple properties

I'm writing an application which requires multiple get methods.

e.g. In my JSP file I'll have the following

<html:text property="factor1" size="45" readonly="true"/>

There are 18 of these each requiring a getFactor#() call in my bean. This 
isn't very efficient but I really can't see any other way of doing it. Can 
anyone suggest a better way of doing this?

Thanks

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Multiple properties

Posted by Victor Hadianto <vi...@nuix.com.au>.
The good thing with Struts is that you can define multiple text fields with 
the same name and the getter/setter method to have param/return as string 
array.

Struts will populate the array with the text fields.

cheers,

victor

On Thu, 11 Apr 2002 21:41, you wrote:
> I'm writing an application which requires multiple get methods.
>
> e.g. In my JSP file I'll have the following
>
> <html:text property="factor1" size="45" readonly="true"/>
>
> There are 18 of these each requiring a getFactor#() call in my bean. This
> isn't very efficient but I really can't see any other way of doing it. Can
> anyone suggest a better way of doing this?
>
> Thanks
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
>
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>

-- 
Victor Hadianto
---------------
Nobody knows what goes between his cold toes and his warm ears. -- Roy Harper

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Multiple properties

Posted by Oliver Reflé <o....@gmx.de>.
I have never tested it with text fields only with multiboxes but should also
work.
Implement a getter/setter like this
public String[] getFactor(){}

public void setFactor(String[]){
	//splitting String
}

Then define factor as property and struts should automaticly
create a string[] and pass it to your propert

Oliver

-----Original Message-----
From: Richard Sweeney [mailto:riksweeney@hotmail.com]
Sent: Thursday, April 11, 2002 1:41 PM
To: struts-user@jakarta.apache.org
Subject: Multiple properties


I'm writing an application which requires multiple get methods.

e.g. In my JSP file I'll have the following

<html:text property="factor1" size="45" readonly="true"/>

There are 18 of these each requiring a getFactor#() call in my bean. This
isn't very efficient but I really can't see any other way of doing it. Can
anyone suggest a better way of doing this?

Thanks

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>