jersey HTTP Status 400 - Bad Request

原因是jersey 内置的转换器,只能做简单的类型转换如:

首先客户端提交上来的一定是String;

String ----> String/Long/Boolean 这些基本的 可以转换,但是如果你如下写:

把String---->Date类型,那么jersey内部 就会出错,报非法的请求报文,无从调试起(花了2天才明白,以后不要再犯)

可以修改为String,然后下面如果用到的地方 转换下,如下图:

时间: 2025-01-01 13:41:33

jersey HTTP Status 400 - Bad Request的相关文章

springMVC 文件上传 HTTP Status 400 – Bad Request

可能原因是:multipartResolver没有配置正确 请看解决方案: <!--文件上传 id必须为multipartResolver,不然报错HTTP Status 400 – Bad Request--> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <propert

解决 spring mvc3.1下post json出现HTTP Status 400 The request sent by the client was syntactically incorrect

问题描述: 已声明 @RequestMapping(value="update", method = RequestMethod.POST)     @ResponseBody     public Map<String, Result> updateNavi(@RequestBody Navigation model) 启动日志有: Mapped "{[/navi/update],methods=[POST],params=[],headers=[],consu

Spring MVC,HTTP Status 400 ,jQuery

一.先看下4xx错误的说明 [转载] http status 400,http 400,400 错误 [参考] status code 400, Bad Request (§10.4.1) 4 请求失败4xx 4xx应答定义了特定服务器响应的请求失败的情况.客户端不应当在不更改请求的情况下重新尝试同一个请求.(例如,增加合适的认证信息).不过,同一个请求交给不同服务器也许就会成功. 4.1 400 Bad Request 请求中的语法错误.Reason-Phrase应当标志这个详细的语法错误,比

HttpWebRequest.GetResponse() raises exception when http status code 400 (bad request) is returned

参考: .Net HttpWebRequest.GetResponse() raises exception when http status code 400 (bad request) is returnedC# code using System;using System.IO;using System.Net; public class Test{    static void Main()    {        HttpWebRequest request = (HttpWebReq

Failed to load resource: the server responded with a status of 400 (Bad Request) 错误请求解决

前言 这个问题是我在用ajax做文件上传时遇到的,朋友也遇到这种情况,在这里总结一下 分析 Failed to load resource: the server responded with a status of 400 (Bad Request)   是错误请求的报错 出现这种错误一般情况是: 1.前端的参数类型和后端的参数类型不匹配,比如前端string 类型,后端是date类型 <input type="date" id="bornDay" name

Cause of 400 Bad Request Errors

The 400 Bad Request error displays inside the Internet browser window, just as web pages do. Cause of 400 Bad Request Errors The 400 Bad Request error is an HTTP status codethat means that the request you sent to the website server (e.g. a request to

HTTP Status 415 HTTP Status 400 Post @requestbody Springmvc

1,先说一下自己的问题,用postman测试数据 <html> <head> <title>Apache Tomcat/7.0.59 - Error report</title> <style> <!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white

400 Bad Request The request sent by the client was syntactically incorrect ().

项目中一直出现400错误,后面搜索下,发现如下内容. SpringMVC报错信息为The request sent by the client was syntactically incorrect () 在数据绑定的时候一定要主意Controller方法中的参数名和jsp页面里的参数名字是否一致或者按照绑定的规范来写,如果不一致,可能回报如下错误: The request sent by the client was syntactically incorrect (). 从字面上理解是:客户

urllib2.HTTPError: HTTP Error 400: Bad Request

1 import urllib2 2 import re 3 import os 4 5 def process_item(self, item, spider): 6 headers = { 7 "Host": 'img31.mtime.cn', 8 "User-Agent": 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:53.0) Gecko/20100101 Firefox/53.0', 9 "