NutzCN Logo
问答 http请求自身服务器,请求不到相应的数据且不进入该请求方法.
发布于 271天前 作者 qq_046f8286 370 次浏览 复制 上一个帖子 下一个帖子
标签:

发送请求的代码

public Object getExcelData(String url, String params, List<XtExcelDownLoadPojo> dataList) {
		System.out.println(url);
		System.out.println(params);
		String resultJson = HttpClientUtil.getInstance().sendHttpPost("http://localhost:8080" + url,params,"application/json");
		System.out.println(resultJson);
		return null;
	}
参数:
url:
/fzzl/hrp/m/employee/controller/mEmployee/queryEmployeeList
params:{"name":"","idCard":"","startDateShort":"","endDateShort":"","customerIds":"","customerStoreIds":"","customerPositionIds":"","employeeStatusId":"1","isSpecificDisease":""}

要请求的代码

@At("/queryEmployeeList")
	@Ok("json")
	public Object queryEmployeeList(@Param("..") Map map) {
		System.out.println("我来了.");
		return mEmployeeService.queryEmployeeList(map);
	}

log日志:

2018-03-13 17:31:09  [DEBUG] org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) - Found mapping for [POST] path=/hrp/m/employee/controller/mEmployee/queryEmployeeList : MEmployeeAction.queryEmployeeList(MEmployeeAction.java:91)
2018-03-13 17:31:09  [DEBUG] org.nutz.ioc.impl.NutIoc.get(NutIoc.java:157) - Get 'mEmployeeAction'<class com.fzzl.hrp.m.employee.controller.MEmployeeAction>
4 回复

是不是没登录导致被拦截了? 例如shiro 或者CheckSession

解决了。谢了。

原因是什么呢?

没有session信息.在action的时候就被挡了。

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