• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

strut bean write tag

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
This is a snippet of my jsp page using struts tags. When the jsp page displays, the value of 'totalNumber'(data type is long) bean property is appended with (unknown) just before the value. Say, if the totalNumber value is 100 it displays as (unknown)100. Anyone has got any clue on this?
This is happening only for long data type.

thanks in advance!

[CODE]
//All struts tld's import statement here

<tiles:importAttribute name='bean'/>
<tiles:useAttribute name="property" classname="java.lang.String"/>
<bean efine id='activityInfo' name='bean' property='<%= property %>'/>
<tiles:useAttribute name="javascript" classname="java.lang.String"/>
<tiles:useAttribute name="label" classname="java.lang.String"/>
<tr>
<td align=left height=20>
<logic:notEqual name='activityInfo' property='totalNumber' value='0'>
<a href="<%=javascript%>">
<b><%= label%></b></a>
</logic:notEqual>
<logic:equal name='activityInfo' property='totalNumber' value='0'>
<b><%= label%></b>
</logic:equal></td>
<td align=right ><bean:write name='activityInfo' property='totalNumber'/> </td>
<td align=right colspan="2"><bean:write name='activityInfo' property='displayAmount'/> </td>
</tr>

[CODE]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've never seen (unknown) appended to a value before, but here's one thing you might try: create a public String getFormattedTotalNumber() method on your bean that converts the long value to a String and returns it. Then change the property on your bean:write to "formattedTotalNumber".
[ January 11, 2006: Message edited by: Merrill Higginson ]
 
Monoj Barma
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Merrill!
I will try that!
 
Monoj Barma
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks again Merril!

I got the solution!
just added format='' and that removes the (unknown)

[CODE] <td align=right ><bean:write name='activityInfo' property='totalNumber' format=''/> </td>
[CODE]
 
money grubbing section goes here:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic