--- yitzle <[EMAIL PROTECTED]> wrote: > "Note that all parameter values for a given name > will be returned, so the type of the objects in the > map is java.lang.String[]." > > When I try reading data from the Map and converting > to a String, I get a casting error: > java.lang.ClassCastException: [Ljava.lang.String; > cannot be cast to java.lang.String > > I did this: > public void setParameters (Map map) > { > Object m = map.get("criteria"); > message = m.toString(); > } > then displayed the message. I get > "[Ljava.lang.String;@e35bb7" > > Any clues? Bug?
You quote the documentation, which tells you *precisely* what's happening, then you write code that does something differently, and are suprised when you get an exception verifying what the documentation you quoted states. > Note that all parameter values for a given name > will be returned, so the type of the objects in > the map is java.lang.String[]. Why would you not use a String[] as the type of variable you're retrieving from the map when the documentation states that the type of the objects in the map is String[]? d. ____________________________________________________________________________________ Get the free Yahoo! toolbar and rest assured with the added security of spyware protection. http://new.toolbar.yahoo.com/toolbar/features/norton/index.php --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]