• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting string variable with bean tag  RSS feed

Rashid Darvesh
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have the following code which works fine i have a variable defined in session scope by name RR and it is a collection of Product bean.

<logic:iterate id="product" name="RR" scope="request" type="com.nilgiri.crs.customerResearch.Model.Product">
<td>productID = <bean:write name="product" property="productID" /> </td>
<td>productName = <bean:write name="product" property="productName" /> </td>
<td>price = <bean:write name="product" property="price" /> </td>
<td><textarea name="description" cols="25" rows="5">
<bean:write name="product" property="price" />
</textarea> </td>
what i wanted to do was that based on the product description i want to dynamically increase the row size of the text area(as of now i hardcoded it ot be 5) for that i want to grab the desc in a string varibale and get the size of the string and bassed on that i want to set a rows of textarea with some mathematical calculation.
i tried the following ways but no success1 can anyone tell me which one is correct
<% String st = "<bean:write name="product" property="price" />" ;%> or
<%String st = product.Desc;%>//considering product is the id in the iterate tag.
any help will be appreciated.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!