Error 400 Bad Request

错误日志如下:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Error 400 Bad Request</title>
</head>
<body><h2>HTTP ERROR 400</h2>
<p>Problem accessing /poi/black/list/opLogs. Reason:

<pre>    Bad Request</pre></p><hr ><i><small>Powered by Jetty://</small></i><br>    


我们知道400开头的是客户端错误,比如有可能是参数错误之类的,但也可能是服务端没有配置好导致的。

我的这个错误原因是,在SpringMvc的Controller接收参数的时候,如下所示:


    public ResultVo opLogs(@RequestBody MyDomain mydomain) {}


org.springframework.web.bind.annotation.RequestBody注解


但是在MyDomain中我添加了一个新的构造方法,这样就没有默认的构造方法,所以一直提示400.

解决办法,添加无参的构造方法就可以解决

你可能感兴趣的:(Error 400 Bad Request)