@At("/jgxx/info")
public class test {
@AdaptBy(type = JsonAdaptor.class)
@At("/select/**")
@POST
public String getUser(@Param("..") NutMap jgxx) {
// TODO 这里是实现代码
System.out.println("jgxx"+jgxx);
JSONObject json = new JSONObject();
json.put("code", 200);
json.put("message", "请求成功!");
json.put("data", "");
return json.toString();
}
}
请求代码
Map<String, Object> parms = new HashMap<String, Object>();
parms.put("version", "NutzTest");
parms.put("website", Nutz.version());
String response = Http.post("http://127.0.0.1/test/info/select/", paramlist, 5 * 1000);
报错信息
2019-04-03 17:15:23,667 [WARN][org.nutz.mvc.impl.processor.FailProcessor] - Error@/jgxx/info/select/index :
org.nutz.json.JsonException: !Json syntax error nearby [row:1,col:1 char 'b'], reason: 'Unexpect String = bz=&czhm=&djip=192.168.1.100&djr=61031069'
at org.nutz.json.impl.JsonTokenScan.readObject(JsonCompileImplV2.java:304)
at org.nutz.json.impl.JsonTokenScan.read(JsonCompileImplV2.java:360)
at org.nutz.json.impl.JsonCompileImplV2.parse(JsonCompileImplV2.java:27)
at org.nutz.json.Json.fromJson(Json.java:42)
at org.nutz.mvc.adaptor.JsonAdaptor.getReferObject(JsonAdaptor.java:41)
at org.nutz.mvc.adaptor.AbstractAdaptor.adapt(AbstractAdaptor.java:250)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:25)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:218)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)