springCloud异常:下游服务经过Gateway网关过滤之后拿不到HttpServletRequest

下游服务controller:

public class BaseController { 
protected String sessionId = null; 
protected void getSessionIdFromRequest(HttpServletRequest request) {
 this.sessionId = request.getHeader().get("Session-Id");
 }
}

报错信息:

No primary or default constructor found for interface javax.servlet.http.HttpServletReques

原因:Gateway中不支持HttpServletRequest,换成ServerHttpRequest即可!!!

转载于:https://my.oschina.net/u/3734816/blog/3075217

你可能感兴趣的:(springCloud异常:下游服务经过Gateway网关过滤之后拿不到HttpServletRequest)