Package javax.servlet.jsp

Examples of javax.servlet.jsp.JspException


      throws JspException {
    String attrValue = null;
    try {
      attrValue = evalStringAttr(attrName, getAttr(attrName));
    } catch (Exception e) {
      throw new JspException(
          " Evaluation attribute failed " + e.getMessage(), //$NON-NLS-1$
          e);
    }

    return attrValue;
View Full Code Here


            throws JspException {
        JspWriter writer = context.getOut();
        try {
            writer.print(data);
        } catch (Exception e) {
            throw new JspException(
                    "Failure writing to pageContext.  Exception = " //$NON-NLS-1$
                            + e.getMessage(), e);
        }
    }
View Full Code Here

     */
    @Override
  public int doStartTag() throws JspException {
        ATag parent = (ATag)findAncestorWithClass(this, ATag.class);
        if (parent == null) {
            throw new JspException("The queryparam tag must be a child of the a tag"); //$NON-NLS-1$
        }
       
        String nameEval = evaluateStringAttribute(Constants.NAME);
               
        String valueEval = evaluateStringAttribute(Constants.VALUE);
View Full Code Here

    try {
      this._displayValue = evalStringAttr(Constants.DISPLAY_VALUE,
          dispExpr);
    } catch (Exception e) {
      throw new JspException(
          " Evaluation attribute failed " + e.getMessage(), e); //$NON-NLS-1$
    }
    // now remove this attr from map
    // so not output in genHTML()
    removeAttr(Constants.DISPLAY_VALUE);
View Full Code Here

    String valueval = null; // init diff of checkval
    try {
      valueval = evalStringAttr(Constants.VALUE, valueExpr);
    } catch (Exception e) {
      throw new JspException(
          " Evaluation attribute failed " + e.getMessage(), e); //$NON-NLS-1$
    }

    // see if this is a collection
    Collection<?> collection = null;
    try {
      collection = evalCollectionAttr(Constants.CHECKED, this._checked);
    } catch (Exception e) {
      // ignore, try array next;
    }

    Object[] array = null;
    if (collection == null) {
      try {
        array = evalArrayAttr(Constants.CHECKED, this._checked);
      } catch (Exception e) {
        // ignore, try string next;
      }
    }

    // init "" for cmp with valueval later
    String checkval = ""; //$NON-NLS-1$
    if (collection == null && array == null) {
      try {
        checkval = evalStringAttr(Constants.CHECKED, this._checked);
      } catch (Exception e) {
        throw new JspException(
            " Evaluation attribute failed " + e.getMessage(), e); //$NON-NLS-1$
      }
    }

    if (collection != null) {
View Full Code Here

        try {
            this._displayValue = evalStringAttr(Constants.DISPLAY_VALUE,
                    this._displayExpr);
        } catch (Exception e) {
            throw new JspException(" Evaluation attribute failed " //$NON-NLS-1$
                    + e.getMessage(), e);
        }
    }
View Full Code Here

        String valueval = null; // init diff of checkval
        try {
            valueval = evalStringAttr(Constants.VALUE, valueExpr);
        } catch (Exception e) {
            throw new JspException(" Evaluation attribute failed " //$NON-NLS-1$
                    + e.getMessage(), e);
        }

        // see if this is a collection
        Collection<?> collection = null;
        try {
            collection = evalCollectionAttr(Constants.SELECTED, selectExpr);
        } catch (Exception e) {
            // ignore, try array next;
        }

        Object[] array = null;
        if (collection == null) {
            try {
                array = evalArrayAttr(Constants.SELECTED, selectExpr);
            } catch (Exception e) {
                // ignore, try string next;
            }
        }

        // init "" for cmp with valueval later
        String checkval = ""; //$NON-NLS-1$
        if (collection == null && array == null) {
            try {
                checkval = evalStringAttr(Constants.SELECTED, selectExpr);
            } catch (Exception e) {
                throw new JspException(" Evaluation attribute failed " //$NON-NLS-1$
                        + e.getMessage(), e);
            }
        }

        if (collection != null) {
View Full Code Here

    this._value = getAttr(Constants.VALUE);
    if (this._value != null) {
      try {
        this._value = evalStringAttr(Constants.VALUE, this._value);
      } catch (Exception e) {
        throw new JspException(
            " Evaluation attribute failed " + e.getMessage(), //$NON-NLS-1$
            e);
      }
      // now remove this attr from map
      // so not output in genHTML()
View Full Code Here

        if (this._displayValue != null) {
            try {
                this._displayValue = evalStringAttr(Constants.DISPLAY_VALUE,
                        this._displayValue);
            } catch (Exception e) {
                throw new JspException(" Evaluation attribute failed " //$NON-NLS-1$
                        + e.getMessage(), e);
            }
            // now remove this attr from map
            // so not output in genHTML()
            removeAttr(Constants.DISPLAY_VALUE);
View Full Code Here

        String queryParams = getAttr(Constants.QUERY_PARAMS);
        Map<String, Object> params = this._paramMap;
        // If queryparams are not null and map is not null, error
        if ((queryParams != null) && (params != null)) {
            throw new JspException(
                    "Only one of queryparams or <queryparam> may be used"); //$NON-NLS-1$
        }

        // If queryParams is not null, then href must not be null.
        if ((queryParams != null) || (params != null)) {
            String href = getAttr(Constants.HREF);
            if (href != null) {
                try {
                    href = evalStringAttr(Constants.DISPLAY_VALUE, href);
                    if (params == null) {
                        params = evalHashMapAttr(Constants.QUERY_PARAMS,
                                queryParams);
                    }
                } catch (Exception e) {
                    throw new JspException(" Evaluation attribute failed " //$NON-NLS-1$
                            + e.getMessage(), e);
                }

                // now remove the QUERY_PARAMS attr from map
                // so not output in genHTML()
                removeAttr(Constants.QUERY_PARAMS);

                // Add query params to the end of href.
                String newHref;
                try {
                    newHref = URLHelper.appendQueryParams(href, params);
                } catch (UnsupportedEncodingException e) {
                    throw new JspException(
                            " Adding Query params to href has failed " //$NON-NLS-1$
                                    + e.getMessage(), e);
                }

                // set hrefs value to the href+queryParams value
                setAttr(Constants.HREF, newHref);

            } else {
                throw new JspException("The " + Constants.QUERY_PARAMS //$NON-NLS-1$
                        + " attribute was set, there must also be " //$NON-NLS-1$
                        + "an href attribute set. "); //$NON-NLS-1$
            }

        } // else process href as any other attribute when query params is null.
View Full Code Here

TOP

Related Classes of javax.servlet.jsp.JspException

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.