hi, what's the type conversion in jsp? i read from spec that there're two kinds of conversions: Conversions from String values & Conversions from request-time expressions. i just don't know why we use them thanks,
Say you have a JavaBean with an int property:and you set it inside a JSP:Now the value is really just a string in the JSP source. What the spec says is that this string will be converted to an int with the value 101. Now considerThis time round, the value is a scriptlet evaluated at request time. Even though the result is still a String, the JSP container will not perform any of the automatic conversions and so this code won't work at all (I'd expect it to fail during the java compilation phase). - Peter
posted 18 years ago
Thanks peter, But from spec,Table JSP.4-2, we see: "This (value) attribute can accept a request-time attribute expression as a value." 1) Why the last code segment you gave is wrong? 2) I now supposed you were right, how can we convert the value "101" manually in the scenario?