session可以用于请求后端数据共享

private static void flushSession(HttpServletRequest request, UserInfoDO userInfoDO) {
        String shortName = userInfo.getShortName();
        String empId = userInfoDO.getEmpId();

        Map<String,Object> principalAttributes = new HashMap<>();
        principalAttributes.put(USER_EMP_ID, empId);
        principalAttributes.put(NOTES_NAME, notesName);
        AttributePrincipalImpl attributePrincipal = new AttributePrincipalImpl(shortName,principalAttributes);
        Assertion assertion = new AssertionImpl(attributePrincipal);
        request.getSession(true).setAttribute(AbstractCasFilter.CONST_CAS_ASSERTION, assertion);
    }

 

posted on 2023-07-05 17:26  张释文  阅读(156)  评论(0编辑  收藏  举报