packagecom.mobile.web.common;importorg.springframework.web.filter.OncePerRequestFilter;importjavax.servlet.FilterChain;importjavax.servlet.ServletException;importjavax.servlet.http.Cookie;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletRequestWrapper;importjavax.servlet.http.HttpServletResponse;importjava.io.IOException;import java.util.*;/*** 自定义的过滤器,
* Created by Administrator on 2017/6/19 0019.*/
public class ModifyParametersFilter extendsOncePerRequestFilter {
@Overrideprotected voiddoFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)throwsServletException, IOException {//修改cookie
ModifyHttpServletRequestWrapper mParametersWrapper = newModifyHttpServletRequestWrapper(request);
String token= request.getHeader(“token”);if (token != null && !””.equals(token)) {
mPa