您的位置:首页 > 运维架构 > Tomcat

Spring boot Jetty 服务器相比tomcat的一些不足

2015-11-07 14:24 836 查看
spring boot 使用tomcat服务器

PUT请求 Body中多了一个字段 会有明确的提示
{
"code": 400,
"error": "Bad Request",
"message": "Could not read document: Unrecognized field \"id\" (class com.XXX), not marked as ignorable (8 known properties: ...])\n at [Source: java.io.PushbackInputStream@51c5845a; line: 2, column: 12] (through reference chain: com.XXX[\"id\"]); nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field \"id\" (class com.XXX), not marked as ignorable (8 known properties: ...])\n at [Source: java.io.PushbackInputStream@51c5845a; line: 2, column: 12] (through reference chain: com.XXX[\"id\"])",
"exception": "org.springframework.http.converter.HttpMessageNotReadableException"
}

表示请求Json中多了一个id属性。
但若用Jettty的话 只有如下提示(swagger ui界面中)



如果是POST请求的话 会是如下的输出
{
"code": 400,
"error": "Bad Request",
"message": "Bad Request",
"exception": "org.springframework.http.converter.HttpMessageNotReadableException"}

但仍不知道具体的错误原因 如多了哪个属性
可见Jetty对PUT方法支持的也不是很好
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Jetty Spring-boot