svn commit: r571051 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/JSONServiceEventHandler.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r571051 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/JSONServiceEventHandler.java

byersa-3
Author: byersa
Date: Wed Aug 29 23:41:21 2007
New Revision: 571051

URL: http://svn.apache.org/viewvc?rev=571051&view=rev
Log:
Added some code to convert Timestamp types to string so that this code will handle them.
Not sure why it is limited to the types - String, Number, Map, List.

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/JSONServiceEventHandler.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/JSONServiceEventHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/JSONServiceEventHandler.java?rev=571051&r1=571050&r2=571051&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/JSONServiceEventHandler.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/JSONServiceEventHandler.java Wed Aug 29 23:41:21 2007
@@ -82,6 +82,9 @@
         while (en.hasMoreElements()) {
             String name = (String) en.nextElement();
             Object val = request.getAttribute(name);
+            if (val instanceof java.sql.Timestamp) {
+                val = val.toString();
+            }
             if (val instanceof String || val instanceof Number || val instanceof Map || val instanceof List) {
                 if (Debug.verboseOn()) Debug.logVerbose("Adding attribute to JSON output: " + name, module);
                 attrMap.put(name, val);