Dear All,
Hi. Thank you Stephanie and Hans and some others for answering. The
following seems to be the upshot, and I would not mind if some of you
gurus out there would confirm:
1) The container (basically) requires that the type of argument of
setFoo() must match the type of the return value of getFoo().
2) jsp:setProperty will always send a String, and then conversions are
done as appropriate for the argument of each setFoo().
3) If setFoo() expects an int, and a "b" was sent instead of "7", I
cannot catch this exception. (Except maybe put a scriptlet with a
try() around all of my jsp:setProperty calls, which would be ugly,
IMHO.)
4) Therefore setFoo() has to receive a String, and I have to use
Integer.parseInt(), etc.
5) Therefore getFoo() also has to return a String (because of 1)
above).
6) Therefore, in order to be able to catch such exceptions--which of
course should be done, really the only type of variables which can
be processed in a bean from a JSP is a String (and then doing all
of the conversions). This is contrary to all of the material one
reads on the matter.
Is this how other people handle this issue?
Thanx for your thoughts,
Aaron
--
Aaron ("Aharon") Naiman | Jerusalem College of Technology--Machon Lev
[EMAIL PROTECTED] | http://hobbes.jct.ac.il/~naiman
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets