List Info

Thread: Created: (WW-2299) property tag forcing values into Long




Created: (WW-2299) property tag forcing values into Long
country flaguser name
United States
2007-11-06 10:04:35
property tag forcing values into Long
-------------------------------------

                 Key: WW-2299
                 URL: https
://issues.apache.org/struts/browse/WW-2299
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.0.9
         Environment: Tomcat 6.0.14,
Java 6u3
Windows XP
            Reporter: Mike Calmus


Instances of property are not behaving properly when inside
a displaytag table tag:

    <display:table name="grants"
class="its" id="grant">
      <display:column title="PI name"
property="piFullName" sortable="true"
headerClass="sortable"/>
      <display:column title="RFA PA"
sortable="true"
headerClass="sortable">
        <s:property
value="${grant.rfaPaNumber}" />
      </display:column>

The value returned by getRfaPaNumber is a String (for
example: PAR98-103). When the above snippet is used, the
displayed value is "-103.0". If I change it to use
the JSTL core class, (c:out in place of s:property),
everything displays as expected. Using s:property in other
places seems to work fine as well.

In the above snippet, using the following:

        <s:property value="${'a' +
grant.rfaPaNumber}" />

gives a NumberFormatException:

java.lang.NumberFormatException: For input string:
"a"
	at
java.lang.NumberFormatException.forInputString(NumberFormatE
xception.java:48)
	at java.lang.Long.parseLong(Long.java:403)
	at java.lang.Long.<init>(Long.java:671)
	at
org.apache.el.lang.ELArithmetic$LongDelegate.coerce(ELArithm
etic.java:188)
	at
org.apache.el.lang.ELArithmetic.coerce(ELArithmetic.java:356
)
	at
org.apache.el.lang.ELArithmetic.add(ELArithmetic.java:237)
	at org.apache.el.parser.AstPlus.getValue(AstPlus.java:24)
	at
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionIm
pl.java:186)
	at
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluat
e(PageContextImpl.java:923)


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue
online.


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )