If the jsp file do not set the Property of the bean, what is the output ? <jsp:getProperty name="test" property="name" /> <jsp:getProperty name="test" property="age" /> In the javabean, I define name as String and age as int. I find that the output is "" and 0, but the output of podar mock exam is null and null. Why?? Thanks a lot !!!
Peter den Haan
posted 14 years ago
The mock is at least partly wrong. Primitives can't be null and int defaults to 0 instead, so age would definitely return 0. The name would be null by default, but the JSP specification could be clearer on what the container should output for a null value. It does state in the javadoc for JspWriter that print((String)null) should output the string "null", so really a container should do just that. Bottom line is: the mock is wrong on the age, but your JSP container is wrong on the name - Peter
Oh the stink of it! Smell my tiny ad!
the new thread boost feature: great for the advertiser and smooth for the coderanch user