Hi All if you we use <jsp:getProperty >action we will get a string represent that data,if i want to convert or cast that string to double or integer or something else,how do we do that. i know there is a way to access the bean property using scriplets and do all the conversion that i need,but how do we parse or cast or convert that string which we get using that action to primitives data type or other objects if i need it. or at least how to assign that output from that action to a variable. thanks for your help.
Thanks for your help.
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
posted
0
Surely if you want to assign the value from a bean to a variable, you must be doing that in a scriptlet anyway. HTML has ho concept of "variable". If your bean has methods which return appropriate types, you can just call them: <% int x = myBean.getCount(); %> Am I missing something?
Thanks for your reply. i do undersdtand what you said,but can we do something like this: <%String s=<jsp:getProperty name="name" property="count" /> %> i know that doesn't compile,but is there anyway to assign the output of that action to a variable? thanks again.
Ashwin Desai
Ranch Hand
Joined: Jul 17, 2000
Posts: 124
posted
0
Hi, No, I do not think that you could assign the value by using the <jsp:> tag. The best way is to init it as Frank has suggested. Ashwin.
Tom Barns
Ranch Hand
Joined: Oct 27, 2000
Posts: 138
posted
0
Thanks,i do think so.
Anil Vupputuri
Ranch Hand
Joined: Oct 31, 2000
Posts: 527
posted
0
We can not use nested Jsp tags as it leads to compilation error.