Results 1 to 5 of 5
- 11-23-2008, 09:49 PM #1
Member
- Join Date
- Nov 2008
- Posts
- 4
- Rep Power
- 0
-
I wish I could help you, but I left my crystal ball at work. Sorry.
- 11-23-2008, 10:47 PM #3
Member
- Join Date
- Nov 2008
- Posts
- 4
- Rep Power
- 0
just in case you can't see the attachment.
This is the code that fails:
if (cantidadesAlimentos != null){
Iterator mapIterator = cantidadesAlimentos.entrySet().iterator();
for (int i = 0; i < cantidadesAlimentos.size(); i++){
Map.Entry entry = (Map.Entry) mapIterator.next();
String key = entry.getKey().toString();
String value = entry.getValue().toString();
if(key.compareTo("recalcular") != 0){
fails here>>>> double limiteVariable = (Double.valueOf(value).doubleValue()) / 100;
motorPL.setBounds(motorPL.getNameindex(key, false), limiteVariable, limiteVariable);
}
}
}
this map comes from a JSP:
Map<String, String> cantidadesAlimentos = null;
if (!session.isNew()){
cantidadesAlimentos = request.getParameterMap();
}
The program fails where shown. The variable "key" is OK, it contains "11547" but the variable "value" contains "String[1] (id=142)" (well, when converted to a string it is something else), where it should be "30".
I can see the value 30 expanding the contents of "key". But I couldn't get it out of there
- 11-24-2008, 02:51 AM #4
Member
- Join Date
- Nov 2008
- Posts
- 4
- Rep Power
- 0
getValue() is returning an array of strings, so:
String value = ((String[])entry.getValue())[0];
-
Similar Threads
-
DST issue being faced
By JavaMan in forum New To JavaReplies: 0Last Post: 08-01-2008, 03:30 PM -
WAR issue,please see the details
By milindvijayshah@gmail.com in forum Advanced JavaReplies: 0Last Post: 07-25-2008, 10:51 AM -
Log4j Issue
By nag98 in forum Forum LobbyReplies: 0Last Post: 06-22-2008, 08:22 PM -
Issue with JNI and C library
By AlakaAlaki in forum New To JavaReplies: 1Last Post: 06-13-2008, 12:06 AM -
Issue
By chaitu444 in forum New To JavaReplies: 2Last Post: 11-06-2007, 07:49 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks