public String getUserPrincipal()
    {
        // Create a hash table to hold the results in
        Map info = new TreeMap();

        // Extract the request from the page context
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();

        // Get the principal from the request
        Principal principal = request.getUserPrincipal();

        // Check if there is a principal
        if (principal != null)
        {
            info.put("principal name", principal.getName());
        }
        else
        {
            info.put("principal name", "no principal");
        }

        // Convert the results to an HTML table
        return toHTMLTable("container security", info);
    }
public String getUserPrincipal()
    {
        
        Map info = new TreeMap();

        
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();

        
        Principal principal = request.getUserPrincipal();

        
        if (principal != null)
        {
            info.put("principal name", principal.getName());
        }
        else
        {
            info.put("principal name", "no principal");
        }

        
        return toHTMLTable("container security", info);
    }
public String getUserPrincipal ( ) { // Create a hash table to hold the results in Map info = new TreeMap ( ) ; // Extract the request from the page context HttpServletRequest request = ( HttpServletRequest ) pageContext . getRequest ( ) ; // Get the principal from the request Principal principal = request . getUserPrincipal ( ) ; // Check if there is a principal if ( principal != null ) { info . put ( "principal name" , principal . getName ( ) ) ; } else { info . put ( "principal name" , "no principal" ) ; } // Convert the results to an HTML table return toHTMLTable ( "container security" , info ) ; }
Returns the user principal name.

@return The user principal name.
Returns the user principal name .