Hi janapareddy,
1.java.lang.String mystring = (java.lang.String) pageContext.getAttribute("mystring"); // here mystring will be initialized to "hello"
2 mystring.setMystring(mystring);
You're wrong on these two points.
First one: no javabean mystring won't be initialized. If you would like your javabean to be initialized, then
you should have written
instead of
POint 2:
you've made again two errors:
passing a parameter mystring=hello in the URL would be tranlated into:
equivalent here to
but it is not the case. If it would, do you think the compilator would find a setMystring method?? So, if you don't have any error, that is because this code is not present in the translation unit.
indeed, when using <jsp:setProperty name"xxx" property="*">, the corresponding code generated looks like:
and this form of code is
not aware about existing method or not. If the method invoked on the bean doesn't exist, he doesn't harm.
HTH,
Cyril.
SCJP 1.4, SCWCD, SCBCD, IBM XML, IBM Websphere 285, IBM Websphere 287