struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Calmus (JIRA)" <j...@apache.org>
Subject [jira] Created: (WW-2299) property tag forcing values into Long
Date Tue, 06 Nov 2007 16:04:35 GMT
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(NumberFormatException.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(ELArithmetic.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(ValueExpressionImpl.java:186)
	at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:923)


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


Mime
View raw message