Package org.apache.myfaces.trinidad.util

Examples of org.apache.myfaces.trinidad.util.RequestType


  {
    if(CoreRenderKit.isPartialRequest(externalContext))
    {   
      StateManagerImpl.reuseRequestTokenForResponse(externalContext);
     
      RequestType type = ExternalContextUtils.getRequestType(externalContext);
     
      switch(type)
      {
        case SERVLET:
          if(ExternalContextUtils.isHttpServletRequest(externalContext))
View Full Code Here


  @Override
  public ExternalContext getExternalContext(ExternalContext externalContext)
  {
    if(!isApplied(externalContext))
    {
      RequestType type = ExternalContextUtils.getRequestType(externalContext);
     
      switch(type)
      {
        case RESOURCE:
          externalContext.setResponse(new DispatchResourceResponse(externalContext));
View Full Code Here

  static private ExternalContext _getExternalContextWrapper(ExternalContext externalContext, Map<String, String[]> addedParams)
  {
    if(!isApplied(externalContext))
    {
      RequestType type = ExternalContextUtils.getRequestType(externalContext);
     
      switch(type)
      {
        case SERVLET:
          externalContext.setRequest(new UploadRequestWrapper(externalContext, addedParams));
View Full Code Here

  public void beginRequest(ExternalContext ec)
  {
    // asserts for debug which disappear in production
    assert ec != null;
    RequestStateMap state = RequestStateMap.getInstance(ec);
    RequestType requestType = (RequestType) state.get(_REQUEST_TYPE);

    // Do per-virtual request stuff
    if (requestType == null)
    {
      // RequestType may change in a portal environment. Make sure it's set up to enforce the
      // contracts
      requestType = ExternalContextUtils.getRequestType(ec);
      RequestStateMap.getInstance(ec).put(_REQUEST_TYPE, requestType);

      // By contract, Configurators beginRequest is only called once per physical request.
      // The globalConfigurator may be called multiple times, however, so we need to enforce
      // the contract.
      if (!_isDisabled(ec))
      {
        // If this hasn't been initialized then please initialize
        if (!_initialized)
        {
          init(ec);
        }

        _attachRequestContext(ec);

        if (state.get(_IN_REQUEST) == null)
        {
          _startConfiguratorServiceRequest(ec);
        }
      }
      else
      {
        _LOG.fine("GlobalConfigurator: Configurators have been disabled for this request.");
      }
    }
    else if (!requestType.equals(ExternalContextUtils.getRequestType(ec)))
    {
      // This will happen if the actionRequest was not ended before dispatching to the render
      // request
      throw new IllegalStateException("The previous action request was not ended.");
    }
View Full Code Here

   */
  @Override
  public ExternalContext getExternalContext(ExternalContext ec)
  {
    RequestStateMap state = RequestStateMap.getInstance(ec);
    RequestType type = (RequestType) state.get(_REQUEST_TYPE);

    if (type == null)
    {
      beginRequest(ec);
      type = (RequestType) state.get(_REQUEST_TYPE);
    }
    else if (!ExternalContextUtils.getRequestType(ec).equals(type))
    {
      throw new IllegalStateException("The expected request type is not the same as the current request type.");
    }

    if (!_isDisabled(ec))
    {
      if (!type.isPortlet() && _isSetRequestBugPresent(ec))
      {
        //This handles bug 493 against the JSF-RI 1.2_03 and earlier.  If the bug
        //is present in the current system, add a wrapper to fix it

        //TODO sobryan this is somewhat inefficient so should be removed when we
View Full Code Here

    String viewId = context.getViewRoot().getViewId();
    String action =
      context.getApplication().getViewHandler().getActionURL(context, viewId);
    renderEncodedActionURI(context, "action", action);

    RequestType type = ExternalContextUtils.getRequestType(ec);

    //Always add expando to portlet form
    if(type.isPortlet())
    {
      renderEncodedResourceURI(context, "_trinPPRAction", action);
    }

    if (supportsTarget(rc))
View Full Code Here

    String viewId = context.getViewRoot().getViewId();
    String action =
      context.getApplication().getViewHandler().getActionURL(context, viewId);
    renderEncodedActionURI(context, "action", action);
   
    RequestType type = ExternalContextUtils.getRequestType(ec);
   
    //Always add expando to portlet form
    if(type.isPortlet())
    {
      renderEncodedResourceURI(context, "_trinPPRAction", action);
    }
   
    if (supportsTarget(arc))
View Full Code Here

    String viewId = context.getViewRoot().getViewId();
    String action =
      context.getApplication().getViewHandler().getActionURL(context, viewId);
    renderEncodedActionURI(context, "action", action);
   
    RequestType type = ExternalContextUtils.getRequestType(ec);
   
    //Always add expando to portlet form
    if(type.isPortlet())
    {
      renderEncodedResourceURI(context, "_trinPPRAction", action);
    }
   
    if (supportsTarget(arc))
View Full Code Here

  public void beginRequest(ExternalContext ec)
  {
    // asserts for debug which disappear in production
    assert ec != null;
    RequestStateMap state = RequestStateMap.getInstance(ec);
    RequestType requestType = (RequestType) state.get(_REQUEST_TYPE);

    // Do per-virtual request stuff
    if (requestType == null)
    {
      // RequestType may change in a portal environment. Make sure it's set up to enforce the
      // contracts
      requestType = ExternalContextUtils.getRequestType(ec);
      RequestStateMap.getInstance(ec).put(_REQUEST_TYPE, requestType);

      // By contract, Configurators beginRequest is only called once per physical request.
      // The globalConfigurator may be called multiple times, however, so we need to enforce
      // the contract.
      if (!_isDisabled(ec))
      {
        // If this hasn't been initialized then please initialize
        if (!_initialized)
        {
          init(ec);
        }

        _attachRequestContext(ec);

        if (state.get(_IN_REQUEST) == null)
        {
          _startConfiguratorServiceRequest(ec);
        }
      }
      else
      {
        _LOG.fine("GlobalConfigurator: Configurators have been disabled for this request.");
      }
    }
    else if (!requestType.equals(ExternalContextUtils.getRequestType(ec)))
    {
      // This will happen if the actionRequest was not ended before dispatching to the render
      // request
      throw new IllegalStateException("The previous action request was not ended.");
    }
View Full Code Here

   */
  @Override
  public ExternalContext getExternalContext(ExternalContext ec)
  {
    RequestStateMap state = RequestStateMap.getInstance(ec);
    RequestType type = (RequestType) state.get(_REQUEST_TYPE);

    if (type == null)
    {
      beginRequest(ec);
      type = (RequestType) state.get(_REQUEST_TYPE);
    }
    else if (!ExternalContextUtils.getRequestType(ec).equals(type))
    {
      throw new IllegalStateException("The expected request type is not the same as the current request type.");
    }

    if (!_isDisabled(ec))
    {
      if (!type.isPortlet() && _isSetRequestBugPresent(ec))
      {
        //This handles bug 493 against the JSF-RI 1.2_03 and earlier.  If the bug
        //is present in the current system, add a wrapper to fix it

        //TODO sobryan this is somewhat inefficient so should be removed when we
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.util.RequestType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.