Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
302
Chapter 13 Using JavaBeans with JSP
Automatic Type Conversions
Table 13.1 summarizes the automatic type conversions performed when a
bean property is automatically associated with an input parameter. One warn
ing is in order, however: both JSWDK 1.0.1 and the Java Web Server 2.0 have
a bug that causes them to crash at page translation time for pages that try to
perform automatic type conversions for properties that expect
double
values.
Tomcat and most commercial servers work as expected.
Core Warning
With the JSWDK and the Java Web Server, you cannot associate properties
that expect double precision values with input parameters.
Table 13.1 Type Conversions When Properties Are Associated with
Input Parameters
Property Type Conversion Routine
boolean
Boolean.valueOf(paramString).booleanValue()
Boolean
Boolean.valueOf(paramString)
byte
Byte.valueOf(paramString).byteValue()
Byte
Byte.valueOf(paramString)
char
Character.valueOf(paramString).charValue()
Character
Character.valueOf(paramString)
double
Double.valueOf(paramString).doubleValue()
Double
Double.valueOf(paramString)
int
Integer.valueOf(paramString).intValue()
Integer
Integer.valueOf(paramString)
float
Float.valueOf(paramString).floatValue()
Float
Float.valueOf(paramString)
long
Long.valueOf(paramString).longValue()
Long
Long.valueOf(paramString)
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved