public Object getUserFromPrincipal(HttpServletRequest request) {
    Debug.logVerbose("[JdonFramework]--> enter getUserFromPrincipal", module);
    Principal principal = request.getUserPrincipal();
    if (principal == null) {
      Debug.logVerbose("[JdonFramework]principal is null, not login by JAAS", module);
      return null;
    }
    String username = principal.getName();
    Debug.logVerbose("[JdonFramework]--> find the logined username=" + username, module);
    HttpSession session = request.getSession();
    Object model =  session.getAttribute(USERMODEL);
    if (model == null) {
      model = findUserModelIFByName(request, username);
      session.setAttribute(USERMODEL, model);
    }
    return model;
  }
public Object getUserFromPrincipal ( HttpServletRequest request ) { Debug . logVerbose ( "[JdonFramework]--> enter getUserFromPrincipal" , module ) ; Principal principal = request . getUserPrincipal ( ) ; if ( principal == null ) { Debug . logVerbose ( "[JdonFramework]principal is null, not login by JAAS" , module ) ; return null ; } String username = principal . getName ( ) ; Debug . logVerbose ( "[JdonFramework]--> find the logined username=" + username , module ) ; HttpSession session = request . getSession ( ) ; Object model = session . getAttribute ( USERMODEL ) ; if ( model == null ) { model = findUserModelIFByName ( request , username ) ; session . setAttribute ( USERMODEL , model ) ; } return model ; }
将UserModel从登陆的Principal中获取后，
Principal当用户访问被授权区域，会由Web容器自动产生。
保存在HttpSession中，供其它Web层组件使用。
@param request