You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ravi_eze <ra...@ivycomptech.com> on 2008/02/21 16:19:17 UTC

problem in populating Maps

hi,

I am trying to populate a LinkedHashMap located in a DTO from a
<s:textfield.. /> When i turn on the debug mode i seed the following error
on the console:

ERROR (com.opensymphony.xwork2.interceptor.ParametersInterceptor:199) -
Developer Notification (set struts.devMode to false to disable this
message):
Error setting expression 'currentEvent.excludeRulesValues['dd']' with value
'[Ljava.lang.String;@1f09665'
424209 [http-8080-Processor24] ERROR
com.opensymphony.xwork2.interceptor.ParametersInterceptor  - Developer
Notification (set struts.devMode to false to disable this message):

I am using the following syntax in the jsp:
			< td >
			Ignore people who have been given >= <s:textfield
				name="current.rules['dd']" />
			offers previously from EDS< /td > 

The action class is having current defined as a Dto with getters and
setters, and rules is the LinkedHashMap defined in the DTO with getters and
setters. The constructor of the Action class instantiates the 'current'
variable and constructor of Dto instantiates the 'rules' variable of DTO.

and in the textbox generated i entered dd as the input text.

Any ideas why this is not working??? 

regards,
ravi 
-- 
View this message in context: http://www.nabble.com/problem-in-populating-Maps-tp15613167p15613167.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: problem in populating Maps

Posted by Maxx <ma...@gmail.com>.
On Sun, Feb 24, 2008 at 4:37 PM, Dave Newton <ne...@yahoo.com> wrote:
>
>  [...] the error is this:
>
>
>  >> Error setting expression 'currentEvent.excludeRulesValues['dd']' with
>  >> value '[Ljava.lang.String;@1f09665'
>
>  which looks more like it's trying to set a single String with a String[].

And how do we might fix this thing..?

I can understand that a <s:select /> can return several String values,
but a <s:textfield /> ...?!
And even if the HTML/HTTP or what-so-ever standard involved allows
that multiple values are returned for the same parameter (what seems
to be commonly argued in this situation), why setting the value for a
single String field in an Action do not lead to this exception?!

Maxx

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


Re: problem in populating Maps

Posted by Dave Newton <ne...@yahoo.com>.
--- Martin Gainty <mg...@hotmail.com> wrote:
> 2) it is quite possible you have *may* a stale TO
>
http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html
> have you considered using a factory with Timestamps/Versions to either
> quiesce the old TOs or somehow update old contents with new?

That's unlikely; the error is this:

>> Error setting expression 'currentEvent.excludeRulesValues['dd']' with
>> value '[Ljava.lang.String;@1f09665'

which looks more like it's trying to set a single String with a String[].

> 3)s:textfield Whichever value is being returned from the 
> LinkedMap's value has to not have these embedded chars
> = , # :

Why not? I don't have any issues using those characters as map values or
displaying (or submitting) them in <s:textfield...>s.

Dave


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


Re: problem in populating Maps

Posted by Martin Gainty <mg...@hotmail.com>.
1)
its possible the link does'nt have that returned object mapped
you may want to consider doing a quick test of the object beforehand with
linkObject.containsValue(ReturnedObject)
http://java.sun.com/javase/6/docs/api/java/util/LinkedHashMap.html#containsV
alue(java.lang.Object)

2)
it is quite possible you have *may* a stale TO
http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html
have you considered using a factory with Timestamps/Versions to either
quiesce the old TOs or somehow update old contents with new?

3)s:textfield
Whichever value is being returned from the LinkedMap's value has to not have
these embedded chars
=
,
#
 :

M-
----- Original Message -----
From: "ravi_eze" <ra...@ivycomptech.com>
To: <us...@struts.apache.org>
Sent: Thursday, February 21, 2008 10:19 AM
Subject: problem in populating Maps


>
> hi,
>
> I am trying to populate a LinkedHashMap located in a DTO from a
> <s:textfield.. /> When i turn on the debug mode i seed the following error
> on the console:
>
> ERROR (com.opensymphony.xwork2.interceptor.ParametersInterceptor:199) -
> Developer Notification (set struts.devMode to false to disable this
> message):
> Error setting expression 'currentEvent.excludeRulesValues['dd']' with
value
> '[Ljava.lang.String;@1f09665'
> 424209 [http-8080-Processor24] ERROR
> com.opensymphony.xwork2.interceptor.ParametersInterceptor  - Developer
> Notification (set struts.devMode to false to disable this message):
>
> I am using the following syntax in the jsp:
> < td >
> Ignore people who have been given >= <s:textfield
> name="current.rules['dd']" />
> offers previously from EDS< /td >
>
> The action class is having current defined as a Dto with getters and
> setters, and rules is the LinkedHashMap defined in the DTO with getters
and
> setters. The constructor of the Action class instantiates the 'current'
> variable and constructor of Dto instantiates the 'rules' variable of DTO.
>
> and in the textbox generated i entered dd as the input text.
>
> Any ideas why this is not working???
>
> regards,
> ravi
> --
> View this message in context:
http://www.nabble.com/problem-in-populating-Maps-tp15613167p15613167.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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