public String getUserId(HttpServletRequest request) {
		HttpSession session = request.getSession();
		return (String) session.getAttribute("userId");
	}
public String getUserId(HttpServletRequest request) {
		HttpSession session = request.getSession();
		return (String) session.getAttribute("userId");
	}
public String getUserId ( HttpServletRequest request ) { HttpSession session = request . getSession ( ) ; return ( String ) session . getAttribute ( "userId" ) ; }
Get the current user's ID from the session

@return string user id or null if no one is logged in
Get the current user s ID from the session