Conversions Performed by the Container
The container automatically takes care of the conversion from text values to the most commonly used Java types. A JSP 2.0-compliant container supports the type conversions shown in Table 22-2.
|
Property type |
Conversion method |
|
|
Boolean.valueOf(String), false for an empty string |
|
|
Byte.valueOf(String), 0 for an empty string |
|
|
String.charAt(0), 0 for an empty string |
|
|
Double.valueOf(String), 0 for an empty string |
|
|
Integer.valueOf(String), 0 for an empty string |
|
|
Float.valueOf(String), 0 for an empty string |
|
|
Long.valueOf(String), 0 for an empty string |
|
|
Short.valueOf(String), 0 for an empty string |
|
|
new String(String) |
These rules apply to attributes for standard actions and custom actions alike.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access