java - Date from Spring to web as timestamp using Jakson -


i have match class , field date start. goal start timestamp. use spring, angularjs, , jackson json converter.

spring controller:

 @requestmapping(value = "/web2/getmatch", method =requestmethod.post)     public @responsebody match  getpickshistory() {         pickdao pd = new pickdao();         return pd.getmatch();       } 

on agularjs controler:

var res = $http.post(urlser.url+"web2/getmatch");     res.success(function(data, status, headers, config) {         // returns data.start = "aug 8, 2015 7:00:00 pm"         // goal timestamp     }); 

i assume 'timestamp' mean numeric timestamp opposed textual representation. can use custom objectmapper:

@component @primary public class customobjectmapper extends objectmapper {     public customobjectmapper() {         configure(serializationfeature.write_dates_as_timestamps, true);     } } 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -