Affects: \
see https://stackoverflow.com/questions/68310198/difference-in-conversion-between-spring-and-spring-boot
test script
application.properties: spring.jackson.serialization.write_dates_as_timestamps=false
Myspring.java: import java.util.Date; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@Controller
@EnableWebMvc
public class Myspring {
@GetMapping(path="/oops")
public @ResponseBody Date oops () {
return new Date();
}
}
expected: curl http://localhost:8080/oops "2021-07-05T18:22:43.364+00:00"
actual: curl http://localhost:8080/oops 1625506637687
Comment From: snicoll
application.properties
is not read at all by Spring Framework, this is a Spring Boot feature. I am going to close this one as there's no need for a duplicate.