struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mail" <rea-fam...@attbi.com>
Subject RE: How to call an array setter
Date Fri, 27 Sep 2002 06:57:49 GMT
I placed this in the Action class and everything compiled, but it moved
everything iteration of gridDetermination MessageCodes into only the first
array iteration.  For example, if I have 7 MessageCodes to load into the
MsgCode array, I only get one MsgCode in the array.  How should I do this to
create an array of MsgCode's?

Thanks!

ResponseProcessAction:
	responseProcessForm.setMsgCode(new String[]
{gridDeterminations.getMessageCode()});

ResponseProcessForm:
	public void setMsgCode(String[] msgCode) {
		this.msgCode = msgCode;
	}

	public String[] getMsgCode() {
		return msgCode;
	}

-----Original Message-----
From: Eddie Bush [mailto:ekbush@swbell.net]
Sent: Thursday, September 26, 2002 10:54 PM
To: Struts Users Mailing List
Subject: Re: How to call an array setter


setMsgCode(new String[] { gridDeterminations.getMessageCode() });

If it's expecting an array, you'll have to give it one.

mail wrote:

>getMessageCode() returns a String.
>
>The error message I get is:
> setMsgCode(java.lang.String[]) in com.coramhc.grid.ResponseProcessForm
>cannot be applied to (java.lang.String)
>
>Any ideas?
>

--
Eddie Bush




--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message