Class PrincipalTag

java.lang.Object
javax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UIOutput
org.apache.shiro.ee.faces.tags.SecureComponent
org.apache.shiro.ee.faces.tags.PrincipalTag
All Implemented Interfaces:
EventListener, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.component.TransientStateHolder, javax.faces.component.ValueHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder

public class PrincipalTag extends SecureComponent

Tag used to print out the String value of a user's default principal, or a specific principal as specified by the tag's attributes.

If no attributes are specified, the tag prints out the toString() value of the user's default principal. If the type attribute is specified, the tag looks for a principal with the given type. If the property attribute is specified, the tag prints the string value of the specified property of the principal. If no principal is found or the user is not authenticated, the tag displays nothing unless a defaultValue is specified.

  • Field Summary

    Fields inherited from class javax.faces.component.UIOutput

    COMPONENT_FAMILY, COMPONENT_TYPE

    Fields inherited from class javax.faces.component.UIComponent

    ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doEncodeAll(javax.faces.context.FacesContext ctx)
     
    void
    restoreState(javax.faces.context.FacesContext context, Object state)
     
    saveState(javax.faces.context.FacesContext context)
     

    Methods inherited from class org.apache.shiro.ee.faces.tags.SecureComponent

    encodeAll, getSubject, verifyAttributes

    Methods inherited from class javax.faces.component.UIOutput

    clearInitialState, getConverter, getFamily, getLocalValue, getValue, markInitialState, resetValue, setConverter, setValue

    Methods inherited from class javax.faces.component.UIComponentBase

    addClientBehavior, addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent

    Methods inherited from class javax.faces.component.UIComponent

    getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PrincipalTag

      public PrincipalTag()
  • Method Details

    • doEncodeAll

      protected void doEncodeAll(javax.faces.context.FacesContext ctx) throws IOException
      Specified by:
      doEncodeAll in class SecureComponent
      Throws:
      IOException
    • saveState

      public Object saveState(javax.faces.context.FacesContext context)
      Specified by:
      saveState in interface javax.faces.component.StateHolder
      Overrides:
      saveState in class javax.faces.component.UIOutput
    • restoreState

      public void restoreState(javax.faces.context.FacesContext context, Object state)
      Specified by:
      restoreState in interface javax.faces.component.StateHolder
      Overrides:
      restoreState in class javax.faces.component.UIOutput