struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Brown <adrianjonbr...@yahoo.com.au>
Subject RE: How to call an array setter
Date Fri, 27 Sep 2002 06:47:22 GMT
Hi,

A String cannot be handed in when it expects a String
array. Try

public String[] getMessageCode() {
     return new String[] { "string here" };
}

Adrian

 --- mail <rea-family@attbi.com> 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?
> 
> -----Original Message-----
> From: Andrew Hill
> [mailto:andrew.david.hill@gridnode.com]
> Sent: Thursday, September 26, 2002 10:43 PM
> To: Struts Users Mailing List
> Subject: RE: How to call an array setter
> 
> 
> The usual way to call an array setter method is with
> an array. Nulls are
> also acceptable.
> 
> getMessageCode() in the gridDeterminations thinghy
> returns what type?
> 
> What compilation / runtime error are you
> experiencing?
> 
> 
> -----Original Message-----
> From: mail [mailto:rea-family@attbi.com]
> Sent: Friday, September 27, 2002 13:49
> To: struts-user@jakarta.apache.org
> Subject: How to call an array setter
> 
> 
> I must be brain-dead right now.  Can anyone tell me
> how to call an array
> setter method?
> 
> ex.
> 
> ResponseProcessForm:
> 
> 	private String[] msgCode = null;
> 
> 	public void setMsgCode(String[] msgCode) {
> 		this.msgCode = msgCode;
> 	}
> 
> 	public String[] getMsgCode() {
> 		return msgCode;
> 	}
> 
> ResponseProcessAction:
> 
> 	/*
> 	 *This does not work, but not sure how to call the
> method??
> 	 */
> 
>
responseProcessForm.setMsgCode(gridDeterminations.getMessageCode());
> 
> 
> 
> --
> 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>
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>  

http://mobile.yahoo.com.au - Yahoo! Messenger for SMS
- Always be connected to your Messenger Friends

--
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