Commit 9cf0d62b by chenzx

工具类提交

parent bc078cbc
package com.keymobile.proxy.util;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
public class HttpUtil {
public static HttpServletRequest getRequest() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
return attributes.getRequest();
}
public static HttpSession getSession () {
HttpSession session = null;
try {
session = getRequest().getSession();
} catch (Exception e) {
}
return session;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment