You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by taj uddin <ta...@yahoo.com> on 2008/12/22 10:19:19 UTC

How to convert output of into int?

Hi,

     In my application i should pass the output of <s:property> tag into a method which accepts only int-type parameter.
So, is there any scope to convert the output of <s:property> tag(which is usually a String) into the int value.
For ex:-In my application I'm passing the output of <s:property>tag into a javascript's addItem() method of menus where my addItem() method is defined to accept int as parameter.
So, pls help me out in this regard.





      

Re: How to convert output of into int?

Posted by Steven Yang <ke...@gmail.com>.
>
> just print the property on your jsp or page actually

for example

var i = <s:property value="int"/>;

will become
var i = 9;

then your javascript will interpret it as an int