Hi,
Since setter will be called setMystring("hello") and there is no such method caller will see following exception
org.apache.jasper.JasperException: Cannot find any information on property 'mystring'
please crosscheck once and advice.
Regards,
Vivek Gupta
About Question enthuware.jwpv6.2.779 :
Moderator: admin
-
- Posts: 17
- Joined: Wed Jan 07, 2015 11:33 pm
- Contact:
-
- Site Admin
- Posts: 10095
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.779 :
The answer and the explanation are correct. Did you try it out?
If you like our products and services, please help us by posting your review here.
-
- Posts: 17
- Joined: Wed Jan 07, 2015 11:33 pm
- Contact:
Re: About Question enthuware.jwpv6.2.779 :
Ok I read the explanation but still I do not agree with the point I have verified by making similar code.
<jsp:useBean id="mystring" class="java.lang.String" />
I agree this will create empty string.
<jsp:setProperty name="mystring" property="*" />
now when you pass following parameter mystring=hello to above JSP wont it call
mstring.setMystring("hello") . Since it does not exist and fail.
<jsp:useBean id="mystring" class="java.lang.String" />
I agree this will create empty string.
<jsp:setProperty name="mystring" property="*" />
now when you pass following parameter mystring=hello to above JSP wont it call
mstring.setMystring("hello") . Since it does not exist and fail.
-
- Site Admin
- Posts: 10095
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.779 :
Again, did you try running the code? It works fine.
It won't call setMystring("hello") because String doesn't have mystring property. When you use property="*", it sets only those properties that exist.
It won't call setMystring("hello") because String doesn't have mystring property. When you use property="*", it sets only those properties that exist.
If you like our products and services, please help us by posting your review here.
-
- Posts: 17
- Joined: Wed Jan 07, 2015 11:33 pm
- Contact:
Re: About Question enthuware.jwpv6.2.779 :
oh ok Thanks !!!!
Who is online
Users browsing this forum: No registered users and 1 guest