Package atg.servlet

Examples of atg.servlet.DynamoHttpServletRequest


    Utils.getDropletEventServlet ().addForm (mFormName);
     
      // Generate the href
      if (mHrefSpecified) {
    // Get the request
    DynamoHttpServletRequest request =
        Utils.getDynamoRequest (mPageContext.getRequest ());
   
    // If the method is POST, make sure to add DARGS as a query argument
    boolean isPost =
        mMethodSpecified &&
        mMethod != null &&
        ("post".equals (mMethod) ||
         "POST".equals (mMethod));
    if (isPost) {
        request.addQueryParameter (DropletConstants.DROPLET_ARGUMENTS, mFormName);
    }
   
    // Encode the action
    String encodedHref =
        request.encodeURL
        (mHref,
         true,
         true,
         false,
         true);
View Full Code Here


      // Get the enclosing form tag
      DSPFormTag dspFormTag = getDSPFormTag ();
      Properties inputAttrs = new Properties();

      // Get the request and response
      DynamoHttpServletRequest request =
  Utils.getDynamoRequest (mPageContext.getRequest ());
      response = request.getResponse();

      // Turn off IllegalStateException for dspjsp pages
      oldStrictValue = response.setStrictOutputAccess(false);

      // See if this is a submit tag
      boolean isSubmit =
        (mTypeSpecified &&
         mType != null &&
         ("submit".equals (mType) ||
          "image".equals (mType)));

      // utility booleans
      boolean isCheckbox =
  (mTypeSpecified &&
   mType != null &&
   "checkbox".equals (mType));
      boolean isRadio =
  (mTypeSpecified &&
   mType != null &&
   "radio".equals (mType));

      // Resolve the bean name against the imports
      mBean = ImportedBeans.resolveName (mBean, mPageContext);

      // Compute the property name
      PropertyName propertyName = PropertyName.createPropertyName (mBean);

      // Compute the string name, which must be calculated specially
      // if the bean is an array reference
      String nameString =
  (mBean.indexOf ('[') >= 0) ?
  DropletDescriptor.evalDynamicDimensions (propertyName, request) :
  mBean;

      // See if that tag's name is overridden by an explicit "name"
      String tagName =
  mNameSpecified ?
  mName :
  nameString;

      // Compute the converters
      ConverterInfo converterInfo =
  Utils.computeConverterInfo
  (mConverter,
   mConverterSpecified,
   mFormat,
   mFormatSpecified,
   mDate,
   mDateSpecified,
   mNumber,
   mNumberSpecified,
   mCurrency,
   mCurrencySpecified,
   mRequired,
   mRequiredSpecified,
   mValueishtml,
   mMindate,
   mMindateSpecified,
   mMaxdate,
   mMaxdateSpecified,
   mNullable,
   mLocale,
   mLocaleSpecified,
   mSymbol,
   mSymbolSpecified,
   mEuro,
   mEuroSpecified,
   mCurrencyConversion,
   mCurrencyConversionSpecified,
         mGroupingsize,
         mGroupingsizeSpecified);
      TagConverter converter = null;
      Properties converterArgs = null;
      if (converterInfo != null) {
  converter = converterInfo.getConverter ();
  converterArgs = converterInfo.getConverterArgs ();
        if (mMindateSpecified && mMindate != null) {
          converterArgs.setProperty("mindate",mMindate);
        }
        if (mMaxdateSpecified && mMaxdate != null){
          converterArgs.setProperty("maxdate",mMaxdate);
        }       
      }

      // Get the value as a String
      String valueString;
      if (mBeanvalueSpecified) {
  if (mParamvalueSpecified || mValueSpecified) {
    throw new JspException (Constants.INPUT_TAG_BAD_VALUEATTRIBUTES);
  }
  // Resolve the bean name against the imports
        mBeanvalue = ImportedBeans.resolveName (mBeanvalue, mPageContext);

  valueString =
    DropletDescriptor.getPropertyStringValue
    (request,
     response,
     mBeanvalue,
     true,
     null,
     null);
      }
      else if (mParamvalueSpecified) {
  if (mBeanvalueSpecified || mValueSpecified) {
    throw new JspException (Constants.INPUT_TAG_BAD_VALUEATTRIBUTES);
  }
        Object paramvalue = request.getObjectParameter(mParamvalue);
        if (null == paramvalue){
          valueString = "";
        }else{
          if(null != converter){
            valueString = converter.convertObjectToString(request,
                                                          paramvalue,
                                                          converterArgs);
          }else{
            valueString = paramvalue.toString();
          }
        }
      }
      else if (mValueSpecified) {
  if (mBeanvalueSpecified || mParamvalueSpecified) {
    throw new JspException (Constants.INPUT_TAG_BAD_VALUEATTRIBUTES);
  }
        if (null != converter &&
            null != mValue &&
            ((String)mValue).trim().length() > 0){

          Object obj = converter.convertStringToObject(request,
                                                       (String)mValue,
                                                       converterArgs);
          valueString = converter.convertObjectToString(request,
                                                        obj,
                                                        converterArgs);
        }else{
          valueString = (mValue == null) ? "" : mValue.toString ();
        }
      }
      else if (isSubmit &&
               (mType.equals("image") ||
                !DropletDescriptor.hasPropertyValue(request, propertyName)))
      {
        // We're trying to emulate the code in
        // atg.servlet.pagecompile.InputSGMLTree
        // that omits a value attribute for certain kinds of submit and all
        // image tags.
        valueString = null;
      }
      else if (isCheckbox &&
               !mValueSpecified){
        valueString = "true";
      }
      else {
  valueString =
    DropletDescriptor.getPropertyHtmlStringValue
    (request,
     response,
     propertyName,
     true,
     converter,
     converterArgs);
      }


     
      // Output the input tag
      //out.print ("<input");

      // Output the type
      if (mTypeSpecified) {
        inputAttrs.put("type",mType);
  //out.print (" type=\"");
  //out.print (mType);
  //out.print ("\"");
      }

      // Output the name
      inputAttrs.put("name",tagName);
      //out.print (" name=\"");
      //out.print (tagName);
      //out.print ("\"");

      // Output the value
      if (valueString != null) {
        inputAttrs.put("value",valueString);
        //out.print (" value=\"");
        //  out.print (valueString);
        //out.print ("\"");
      }

      // Output the "src"
      if (mSrcSpecified) {
        String encodedSrc = request.encodeURL ( mSrc,
                                                true,
                                                true,
                                                true,
                                                true);
        inputAttrs.put("src",encodedSrc);
View Full Code Here

      // Get the enclosing select tag
      SelectTag selectTag = getSelectTag ();

      // Get the request and response
      DynamoHttpServletRequest request =
  Utils.getDynamoRequest (mPageContext.getRequest ());
      DynamoHttpServletResponse response = request.getResponse();

      // Compute the converters
      ConverterInfo converterInfo =
  Utils.computeConverterInfo
  (mConverter,
   mConverterSpecified,
   mFormat,
   mFormatSpecified,
   mDate,
   mDateSpecified,
   mNumber,
   mNumberSpecified,
   mCurrency,
   mCurrencySpecified,
         false,
         false,
   mValueishtml,
   mMindate,
   mMindateSpecified,
   mMaxdate,
   mMaxdateSpecified,
   mNullable,
   mLocale,
   mLocaleSpecified,
   mSymbol,
   mSymbolSpecified,
   mEuro,
   mEuroSpecified,
   mCurrencyConversion,
   mCurrencyConversionSpecified,
         mGroupingsize,
         mGroupingsizeSpecified);
      TagConverter converter = null;
      Properties converterArgs = null;
      if (converterInfo != null) {
  converter = converterInfo.getConverter ();
  converterArgs = converterInfo.getConverterArgs ();
        if (mMindateSpecified && mMindate != null) {
          converterArgs.setProperty("mindate",mMindate);
        }
        if (mMaxdateSpecified && mMaxdate != null){
          converterArgs.setProperty("maxdate",mMaxdate);
        }       
      }

      // Get the value as a String
      String valueString = "";
      if (mBeanvalueSpecified) {
  if (mParamvalueSpecified || mValueSpecified) {
    throw new JspException (Constants.OPTION_TAG_BAD_VALUEATTRIBUTES);
  }
  // Resolve the bean name against the imports
        mBeanvalue = ImportedBeans.resolveName (mBeanvalue, mPageContext);

  valueString =
    DropletDescriptor.getPropertyStringValue
    (request,
     response,
     mBeanvalue,
     true,
     null,
     null);
      }
      else if (mParamvalueSpecified) {
  if (mBeanvalueSpecified || mValueSpecified) {
    throw new JspException (Constants.OPTION_TAG_BAD_VALUEATTRIBUTES);
  }
        Object paramvalue = request.getObjectParameter(mParamvalue);
        if (null == paramvalue){
          valueString = "";
        }else{
          if(null != converter){
            valueString = converter.convertObjectToString(request,
View Full Code Here

        "post".equalsIgnoreCase (mMethod);

      // Generate the action
      if (mActionSpecified) {
        // Get the request
  DynamoHttpServletRequest request =
    Utils.getDynamoRequest (mPageContext.getRequest ());

        // Add this tag as a request attribute so that enclosed tags can get to it
        mPageContext.getRequest().setAttribute(ENCLOSED_FORM_TAG_PARAM_NAME, this);

        // If the method is POST, make sure to add DARGS as a query argument
  if (isPost) {
    request.addQueryParameter ("_DARGS", mFormName);
  }

  // Encode the action
  String encodedAction =
    request.encodeURL
    (mAction,
     true,
     true,
     false,
     true);
View Full Code Here

  try {
      // Get the enclosing form tag
      GoTag goTag = getGoTag ();
     
      // Get the request and response
      DynamoHttpServletRequest request =
    Utils.getDynamoRequest (mPageContext.getRequest ());
      DynamoHttpServletResponse response = request.getResponse();
     
       
      // Resolve the bean name against the imports
      mBean = ImportedBeans.resolveName (mBean, mPageContext);
     
      // Compute the property name
      PropertyName propertyName = PropertyName.createPropertyName (mBean);
     
      // Compute the string name, which must be calculated specially
      // if the bean is an array reference
      String nameString =
    (mBean.indexOf ('[') >= 0) ?
    DropletDescriptor.evalDynamicDimensions (propertyName, request) :
    mBean;
     
      // See if that tag's name is overridden by an explicit "name"
      String tagName =
    mNameSpecified ?
    mName :
    nameString;
     
      // Compute the converters
      ConverterInfo converterInfo =
    Utils.computeConverterInfo
    (mConverter,
     mConverterSpecified,
     mFormat,
     mFormatSpecified,
     mDate,
     mDateSpecified,
     mNumber,
     mNumberSpecified,
     mCurrency,
     mCurrencySpecified,
     mRequired,
     mRequiredSpecified,
     mValueishtml,
     mMindate,
     mMindateSpecified,
     mMaxdate,
     mMaxdateSpecified,
     mNullable,
     mLocale,
     mLocaleSpecified,
     mSymbol,
     mSymbolSpecified,
     mEuro,
     mEuroSpecified,
     mCurrencyConversion,
     mCurrencyConversionSpecified,
                 mGroupingsize,
                 mGroupingsizeSpecified);
      TagConverter converter = null;
      Properties converterArgs = null;
      if (converterInfo != null) {
    converter = converterInfo.getConverter ();
    converterArgs = converterInfo.getConverterArgs ();
      }
     
      // Get the value as a String
      String valueString;
      if (mBeanvalueSpecified) {
    if (mParamvalueSpecified || mValueSpecified) {
        throw new JspException (Constants.INPUT_TAG_BAD_VALUEATTRIBUTES);
    }
    // Resolve the bean name against the imports
    mBeanvalue = ImportedBeans.resolveName (mBeanvalue, mPageContext);
   
    mValue =
        DropletDescriptor.getPropertyValue
        (request,
         response,
         mBeanvalue,
         true,
         null,
         null);
    valueString =
        DropletDescriptor.getPropertyStringValue
        (request,
         response,
         mBeanvalue,
         true,
         null,
         null);
      }
      else if (mParamvalueSpecified) {
    if (mBeanvalueSpecified || mValueSpecified) {
        throw new JspException (Constants.INPUT_TAG_BAD_VALUEATTRIBUTES);
    }
   
    valueString = request.getParameter (mParamvalue);
      }
      else if (mValueSpecified) {
    if (mBeanvalueSpecified || mParamvalueSpecified) {
        throw new JspException (Constants.INPUT_TAG_BAD_VALUEATTRIBUTES);
    }
View Full Code Here

  public int doEndTag ()
    throws JspException
  {
     try {
      // Get the request and response
      DynamoHttpServletRequest request =
          Utils.getDynamoRequest (mPageContext.getRequest ());

      // Output the <img> tag
      //JspWriter out = mPageContext.getOut();
      Properties imgAttrs = new Properties();
      String encodedSrc = null;

      if (mPage != null && mSrc != null) {
        //  cannot have both specified
        throw new JspException (Constants.IMG_SRC_AND_PAGE_SPECIFIED);
      }
      if (mPage != null && mPage.startsWith("/")) {
        // if page is specified we prepend the context path to the URL given
        encodedSrc = request.encodeURL ( mPage,
                                         true,
                                         true,
                                         true,
                                         true,
                                         true,
                      DynamoHttpServletRequest.ENCODE_CONTEXT_PATH );
      }
      else if (mPage != null && (!mPage.startsWith("/"))) {
        // if not absolute path treat "page" as "src"
        encodedSrc = request.encodeURL ( mPage,
                                         true,
                                         true,
                                         true,
                                         true);
      }
      else if (mSrc != null) {
        encodedSrc = request.encodeURL ( mSrc,
                                         true,
                                         true,
                                         true,
                                         true);
      }
View Full Code Here

      // Get the enclosing form tag
      DSPFormTag dspFormTag = getDSPFormTag ();

      // Get the request and response
      DynamoHttpServletRequest request =
        Utils.getDynamoRequest (mPageContext.getRequest ());
      DynamoHttpServletResponse response = request.getResponse();

      // Resolve the bean name against the imports
      mBean = ImportedBeans.resolveName (mBean, mPageContext);

      // Compute the property name
View Full Code Here

      // Get the enclosing form tag
      DSPFormTag dspFormTag = getDSPFormTag ();

      // Get the request and response
      DynamoHttpServletRequest request =
  Utils.getDynamoRequest (mPageContext.getRequest ());
      response = request.getResponse();

      // Turn off IllegalStateException for dspjsp pages
      oldStrictValue = response.setStrictOutputAccess(false);

      // Resolve the bean name against the imports
View Full Code Here

  public int doEndTag ()
    throws JspException
  {
     try {
      // Get the request and response
      DynamoHttpServletRequest request =
          Utils.getDynamoRequest (mPageContext.getRequest ());

      // Output the <img> tag
      //JspWriter out = mPageContext.getOut();
      Properties linkAttrs = new Properties();
      String encodedHref = null;

      if (mPage != null && mHref != null) {
        //  cannot have both specified
        throw new JspException (Constants.LINK_SRC_AND_PAGE_SPECIFIED);
      }
      if (mPage != null && mPage.startsWith("/")) {
        // if page is specified we prepend the context path to the URL given
        encodedHref = request.encodeURL ( mPage,
                                         true,
                                         true,
                                         false,
                                         true,
                                         true,
                      DynamoHttpServletRequest.ENCODE_CONTEXT_PATH );
      }
      else if (mPage != null && (!mPage.startsWith("/"))) {
        // if not absolute path treat "page" as "src"
        encodedHref = request.encodeURL ( mPage,
                                         true,
                                         true,
                                         false,
                                         true);
      }
      else if (mHref != null) {
        encodedHref = request.encodeURL ( mHref,
                                         true,
                                         true,
                                         false,
                                         true);
      }

      //out.print ("<link href=\"");
      linkAttrs.put("href",encodedHref);
      //out.print (encodedHref);
      //out.print ("\"");

      // encode src attribute
      if (mSrc != null) {
        String encodedSrc = request.encodeURL ( mSrc,
                                                true,
                                                true,
                                                false,
                                                true);
        linkAttrs.put("src",encodedSrc);
View Full Code Here

                    "Cannot wrap a DynamoHttpServletRequest with another."
            );
        }


        DynamoHttpServletRequest dynRequest = new DynamoHttpServletRequest();
        dynRequest.setRequest(pRequest);
        setExternalComponentsOnRequest(pNucleus, dynRequest);
        return dynRequest;
    }
View Full Code Here

TOP

Related Classes of atg.servlet.DynamoHttpServletRequest

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.