struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prasanth <dbad...@pangburngroup.com>
Subject Invalid Field Value when using Map
Date Mon, 17 Jun 2019 16:21:55 GMT
Hi,

I have a form that uses maps to store data as shown below. When the user enters valid numbers
it works as expected, but when user enters non digit characters in the text field a String
object is saved 
in the map rather than showing a "Invalid field value for field <field name>" message
which is done for basic data types like int/long/double. Is this something that struts has
not implemented for 
maps yet, as the annotations provide the expected data type?

     @Element(value=java.lang.Double.class)
     private HashMap<Long, Double> deferralAmountValue = new HashMap<Long,Double>();
     @Element(value=java.lang.Double.class)
     private HashMap<Long, Double> deferralPercentValue = new HashMap<Long,Double>();


Thanks,
Prasanth

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message