Package org.apache.myfaces.trinidad.context

Examples of org.apache.myfaces.trinidad.context.RequestContext


    {
      throw new IllegalArgumentException(_LOG.getMessage(
        "EITHER_PATTERN_OR_TYPE_MUST_SPECIFIED"));
    }

    RequestContext reqCtx = RequestContext.getCurrentInstance();
    Locale locale = _getLocale(reqCtx, context);

    NumberFormat fmt = _getNumberFormat(pattern, type, locale, reqCtx);
   
    DecimalFormat df = (DecimalFormat)fmt;
View Full Code Here


      throw new IllegalArgumentException(_LOG.getMessage(
        "EITHER_PATTERN_OR_TYPE_MUST_SPECIFIED"));
    }


    RequestContext reqCtx = RequestContext.getCurrentInstance();
    Locale locale  = _getLocale(reqCtx, context);

    NumberFormat formatter = _getNumberFormat(pattern, type, locale, reqCtx);

    _setFormatProperties(formatter);
View Full Code Here

      return pattern;
   
    if (dfs == null)
    {
      String type = getType();
      RequestContext reqCtx = RequestContext.getCurrentInstance();
      Locale locale = _getLocale(reqCtx, context);
      NumberFormat fmt = _getNumberFormat(pattern, type, locale, reqCtx);
      DecimalFormat df = (DecimalFormat) fmt;
      dfs = df.getDecimalFormatSymbols();
    }
View Full Code Here

  static public final String EMPTY_STYLE_CLASS = "";

  public CoreRenderingContext()
  {
    FacesContext context = FacesContext.getCurrentInstance();
    RequestContext afContext = RequestContext.getCurrentInstance();

    _properties = new HashMap<Object, Object>();

    _outputMode = afContext.getOutputMode();
    _agent = _initializeAgent(context,
                              afContext.getAgent(),
                              // Go back through getOutputMode()
                              // in case anyone has overidden getOutputMode()
                              getOutputMode());

    _initializeSkin(context, afContext);
    _initializePPR(context, afContext);
    // Get and cache (since it can be EL-bound)
    _accessibilityMode = afContext.getAccessibilityMode();
    _animationEnabled = afContext.isAnimationEnabled();

    // Initialize the accessibility profile, providing a default
    // instance if necessary.
    _accessibilityProfile = afContext.getAccessibilityProfile();
    if (_accessibilityProfile == null)
      _accessibilityProfile = AccessibilityProfile.getDefaultInstance();
  }
View Full Code Here

  protected void encodeAll(FacesContext context, RenderingContext arc,
      UIComponent component, FacesBean bean) throws IOException
  {
    // Force MessageBox to be re-rendered via PPR, since the set
    // of messages may have changed.
    RequestContext afContext = RequestContext.getCurrentInstance();
    if (afContext != null)
      afContext.addPartialTarget(component);

    ResponseWriter writer = context.getResponseWriter();

    Map<String, String> origSkinResourceMap = arc.getSkinResourceKeyMap();
View Full Code Here

  {
    // If someone didn't release the RequestContext on an earlier request,
    // then it'd still be around, and trying to create a new one
    // would trigger an exception. We don't want to take down
    // this thread for all eternity, so clean up after poorly-behaved code.
    RequestContext context = RequestContext.getCurrentInstance();
    if (context != null)
    {
      if (_LOG.isWarning())
      {
        _LOG.warning("REQUESTCONTEXT_NOT_PROPERLY_RELEASED");
      }
      context.release();
    }

    // See if we've got a cached RequestContext instance; if so,
    // reattach it
    final Object cachedRequestContext = externalContext.getRequestMap().get(
        _REQUEST_CONTEXT);

    // Catch both the null scenario and the
    // RequestContext-from-a-different-classloader scenario
    if (cachedRequestContext instanceof RequestContext)
    {
      context = (RequestContext) cachedRequestContext;
      context.attach();
    }
    else
    {
      final RequestContextFactory factory = RequestContextFactory.getFactory();
      assert factory != null;
View Full Code Here

    if(RequestType.getType(ec) != RequestType.PORTAL_ACTION)
    {
      ec.getRequestMap().remove(_REQUEST_CONTEXT);
    }
   
    final RequestContext context = RequestContext.getCurrentInstance();
    if (context != null)
    {
      context.release();
      assert RequestContext.getCurrentInstance() == null;
    }   
  }
View Full Code Here

    FacesContext context)
  {
    Locale locale = getLocale();
    if (null == locale)
    {
      RequestContext reqContext = RequestContext.getCurrentInstance()
      if (reqContext != null)
      {
        locale = reqContext.getFormattingLocale();
      }
      if (locale == null)
      {
        locale = context.getViewRoot().getLocale();
      }
View Full Code Here

            format = simpleFormat;
          }
        }

        Calendar cal;
        RequestContext reqContext = RequestContext.getCurrentInstance();
        if (reqContext == null)
        {
          cal = null;
          if(_LOG.isWarning())
          {
            _LOG.warning("NO_REQUESTCONTEXT_TWO_DIGIT_YEAR_START_DEFAULT");
          }
        }
        else
        {
          cal = new GregorianCalendar(reqContext.getTwoDigitYearStart(), 0, 0);
        }
        if (cal != null)
          simpleFormat.set2DigitYearStart(cal.getTime());
      }
View Full Code Here

  {
    TimeZone tZone = getTimeZone();

    if (tZone == null)
    {
      RequestContext context = RequestContext.getCurrentInstance();
      if (context == null)
      {
        _LOG.warning("NO_REQUESTCONTEXT_TIMEZONE_DEFAULT");
      }
      else
      {
        tZone = context.getTimeZone();
      }

      // If RequestContext is null or if it returns a null,
      // then set it to the default time zone which is GMT time zone
      if (tZone == null)
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.context.RequestContext

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.