| | |
| | | import com.se.common.core.text.StrFormatter; |
| | | import org.springframework.util.AntPathMatcher; |
| | | |
| | | import javax.servlet.http.Cookie; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 字符串工具类 |
| | | * |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static String getValueFromCookie(HttpServletRequest request,String key) { |
| | | Cookie[] cookies = request.getCookies(); |
| | | if (cookies == null || cookies.length == 0) { |
| | | return null; |
| | | } |
| | | |
| | | for (Cookie cookie : cookies) { |
| | | if (cookie.getName().equals(key)){ |
| | | return cookie.getValue(); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |