NutzCN Logo
问答 nutz封装MVC时报错
发布于 2707天前 作者 蛋蛋的忧伤 1675 次浏览 复制 上一个帖子 下一个帖子
标签:

我的入口方法这么写的:

	@At
	@AdaptBy(type=JsonAdaptor.class)
	public Object validatePros2(ProTemp[] pros){
		System.out.println(pros.length);
		for (ProTemp pro: pros)
			System.out.println(pro);
		return null;
	}

我的浏览器地址栏这么写的:

http://localhost:8080/api/production/validatePros2?pros=[{id:1,special:2}]

然后我在浏览器network里查看请求结果是:400 bad request
后台报错为:

28-Jun-2017 16:40:56.530 信息 [http-nio-8080-exec-5] org.apache.coyote.http11.AbstractHttp11Processor.process Error parsing HTTP request header
 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
 java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
	at org.apache.coyote.http11.AbstractNioInputBuffer.parseRequestLine(AbstractNioInputBuffer.java:283)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1045)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1533)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1489)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)


很是疑惑

4 回复

是body为json,整个请求体为json,而非某个参数值为json

安卓那边发请求,至少得有个参数键,我应该怎么办....要哭了...

那边发json数组,对象是我的pojo.....我手头无策了

那安卓的程序员得学学怎么发json body了

添加回复
请先登陆
回到顶部