Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    RESTHandler date format

    Is there a way to set the date format in RESTHandler? Seems like there should be a setting for the date format but I could not find it.

    My problem is that the default date format is 'new Date(long)' -so something like

    someDate : new Date(12361523213)

    which is not valid JSON and I am yet to find a parser that will take it. (It works fine in Javascript because it get's eval'ed into an actual date object).

    At the moment, my gruesome workaround is to rip through the raw result and replace 'new Date(12321423)' with an actual formatted date string.

    #2
    This was fixed a long time ago.

    Comment


      #3
      Really? I'm pretty up to date. SGWT2.5 Pro and a build from a few weeks ago.


      Code:
      	<servlet>
      		<servlet-name>RESTHandler</servlet-name>
      		<servlet-class>com.isomorphic.servlet.RESTHandler</servlet-class>
      		<init-param>
      			<param-name>defaultDataFormat</param-name>
      			<param-value>json</param-value>
      		</init-param>
      		<init-param>
      			<param-name>dynamicDataFormatParamName</param-name>
      			<param-value>theDataFormat</param-value>
      		</init-param>
      		<init-param>
      			<param-name>wrapJSONResponses</param-name>
      			<param-value>false</param-value>
      		</init-param>
      	</servlet>
      	<servlet-mapping>
      		<servlet-name>RESTHandler</servlet-name>
      		<url-pattern>/restapi/</url-pattern>
      	</servlet-mapping>

      Comment

      Working...
      X