[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    Calling OGNL static method with date issue
From:       Ken McWilliams <ken.mcwilliams () gmail ! com>
Date:       2010-11-30 19:19:56
Message-ID: 1291144796.2454.18.camel () ken-P5E-VM-HDMI
[Download RAW message or body]

In my jsp I have two dates ("today" and "expiryDate") the following
works in the JSP:
	<s:date name="today" format="yyyy-MM-dd" />
	<s:date name="expiryDate" format="yyyy-MM-dd" />

Now I created two static methods (In a Class called
dateUtils.DateRange):
/* Calling the following from my JSP:
*<s:property value="@dateUtils.DateRange@numTest(5)"/>
* Works just fine...
*/
public static int numTest(int num) {
   return num + 5;
}

/* Calling the following from my JSP:
* <s:property value="@dateUtils.DateRange@dateTest(today)"/>
* DOES NOT WORK
*/ 
public static Date dateTest(Date date) {
   date.setYear(1900);
   return date;
}

Anyone know what's going wrong?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic