Mar*_*idt 9 configuration default spring-mvc spring-boot
到目前为止,我对弹簧启动项目非常满意,但我希望能够更深入地了解所有内容是如何粘合在一起的.使用spring-boot-starter-web,spring-boot-starter-data-jpa和hateoas,我能够组装一个漂亮的REST后端.但我想知道它是如何完成的,例如DataIntegrityViolation很好地转换为像这样的JSON输出.我实际上喜欢提供的信息,但我想知道,我如何重用DataObject转换为JSON.我只是不明白,它来自哪里以及配置的位置.希望大家可以帮助我或指出文档的相关部分甚至源代码.
{
"readyState": 4,
"responseText": "{\"timestamp\":1423155860435,\"status\":500,\"error\":\"Internal Server Error\",\"exception\":\"org.springframework.dao.InvalidDataAccessResourceUsageException\",\"message\":\"could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet\",\"path\":\"/api/catalog/colorfamilies\"}",
"responseJSON": {
"timestamp": 1423155860435,
"status": 500,
"error": "Internal Server Error",
"exception": "org.springframework.dao.InvalidDataAccessResourceUsageException",
"message": "could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet",
"path": "/api/catalog/colorfamilies"
},
"status": 500,
"statusText": "Internal Server Error"
}
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助,Marius
| 归档时间: |
|
| 查看次数: |
4791 次 |
| 最近记录: |