List of usage examples for javax.servlet.http HttpSession hashCode
@HotSpotIntrinsicCandidate public native int hashCode();
From source file:org.kmnet.com.fw.web.logging.mdc.XTrackMDCPutFilter.java
/** * MDC????./*w ww.ja v a 2 s.c o m*/ * * @param request * * @param response * ? * @param chain * ? * @throws IOException * I/O * @throws ServletException * */ @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { MDC.put(REQUEST_ID, RandomStringUtils.randomAlphanumeric(RANDAM_FORMAT_LENGTH)); HttpSession session = ((HttpServletRequest) request).getSession(true); // sessionid?????????????????? String sessionIdentifier = (Integer.toHexString(session.hashCode())); MDC.put(SESSION_ID, sessionIdentifier); // ------------------------ // Filter? // ------------------------ try { filterChain.doFilter(request, response); } finally { // ------------------------ // ? // ------------------------ MDC.remove(REQUEST_ID); MDC.remove(SESSION_ID); } }