Package org.apache.struts.taglib.logic

Examples of org.apache.struts.taglib.logic.IterateTag


        // if "indexed=true", add "index=x" parameter to query string
        // * @since Struts 1.1
        if (indexed) {

            // look for outer iterate tag
            IterateTag iterateTag = (IterateTag) findAncestorWithClass(this, IterateTag.class);
            if (iterateTag == null) {
                // This tag should only be nested in an iterate tag
                // If it's not, throw exception
                JspException e = new JspException(messages.getMessage("indexed.noEnclosingIterate"));
                TagUtils.getInstance().saveException(pageContext, e);
                throw e;
            }

            // calculate index, and add as a parameter
            if (params == null) {
                params = new HashMap(); // create new HashMap if no other params
            }
            if (indexId != null) {
                params.put(indexId, Integer.toString(iterateTag.getIndex()));
            } else {
                params.put("index", Integer.toString(iterateTag.getIndex()));
            }

        }

        // get the pager object
View Full Code Here


     * @throws JspException if 'indexed' tag used outside of iterate tag.
     */
    protected int getIndexValue()
        throws JspException {
        // look for outer iterate tag
        IterateTag iterateTag =
            (IterateTag) findAncestorWithClass(this, IterateTag.class);

        if (iterateTag != null) {
            return iterateTag.getIndex();
        }

        // Look for JSTL loops
        Integer i = getJstlLoopIndex();

View Full Code Here

        {
            return 1;
        }

        // Determine the current row number
        IterateTag iterator = (IterateTag) tag;

        //        return iterator.getLengthCount() + 1;
        return iterator.getIndex() + 1;
    }
View Full Code Here

    protected void prepareIndex(StringBuffer handlers, String name) throws JspException {
  int index = 0;
  boolean found = false;

        // look for outer iterate tag
        IterateTag iterateTag = (IterateTag) findAncestorWithClass(this, IterateTag.class);
  // Look for JSTL loops
  if (iterateTag == null) {
      Integer i = getJstlLoopIndex();
      if (i != null) {
    index = i.intValue();
    found = true;
      }
  } else {
      index = iterateTag.getIndex();
      found = true;
  }
        if (!found) {
            // this tag should only be nested in iteratetag, if it's not, throw exception
            JspException e = new JspException(messages.getMessage("indexed.noEnclosingIterate"));
View Full Code Here

     @exception JspException if 'indexed' tag used outside of iterate tag.
     */
    protected void prepareIndex( StringBuffer handlers, String name )
        throws JspException {
        // look for outer iterate tag
        IterateTag iterateTag = (IterateTag) findAncestorWithClass(this, IterateTag.class);
        if (iterateTag == null) {
             // this tag should only be nested in iteratetag, if it's not, throw exception
             JspException e = new JspException(messages.getMessage("indexed.noEnclosingIterate"));
             RequestUtils.saveException(pageContext, e);
             throw e;
        }
        if( name!=null )
                handlers.append( name );
        handlers.append("[");
        handlers.append(iterateTag.getIndex());
                handlers.append("]");
        if( name!=null )
                handlers.append(".");
    }
View Full Code Here

        // if "indexed=true", add "index=x" parameter to query string
        // since 1.1
        if( indexed ) {

           // look for outer iterate tag
           IterateTag iterateTag =
               (IterateTag) findAncestorWithClass(this, IterateTag.class);
           if (iterateTag == null) {
               // This tag should only be nested in an iterate tag
               // If it's not, throw exception
               JspException e = new JspException
                   (messages.getMessage("indexed.noEnclosingIterate"));
               RequestUtils.saveException(pageContext, e);
               throw e;
           }

           //calculate index, and add as a parameter
           if (params == null) {
               params = new HashMap();             //create new HashMap if no other params
           }
           if (indexId != null) {
            params.put(indexId, Integer.toString(iterateTag.getIndex()));
           } else {
              params.put("index", Integer.toString(iterateTag.getIndex()));
           }
        }

        String url = null;
        try {
View Full Code Here

        // if "indexed=true", add "index=x" parameter to query string
        // * @since Struts 1.1
        if( indexed ) {

           // look for outer iterate tag
           IterateTag iterateTag =
               (IterateTag) findAncestorWithClass(this, IterateTag.class);
           if (iterateTag == null) {
               // This tag should only be nested in an iterate tag
               // If it's not, throw exception
               JspException e = new JspException
                   (messages.getMessage("indexed.noEnclosingIterate"));
               RequestUtils.saveException(pageContext, e);
               throw e;
           }

           //calculate index, and add as a parameter
           if (params == null) {
               params = new HashMap();             //create new HashMap if no other params
           }
           if (indexId != null) {
            params.put(indexId, Integer.toString(iterateTag.getIndex()));
           } else {
              params.put("index", Integer.toString(iterateTag.getIndex()));
           }
        }

        String url = null;
        try {
View Full Code Here

     @exception JspException if 'indexed' tag used outside of iterate tag.
     */
    protected void prepareIndex( StringBuffer handlers, String name )
        throws JspException {
        // look for outer iterate tag
        IterateTag iterateTag = (IterateTag) findAncestorWithClass(this, IterateTag.class);
        if (iterateTag == null) {
             // this tag should only be nested in iteratetag, if it's not, throw exception
             JspException e = new JspException(messages.getMessage("indexed.noEnclosingIterate"));
             RequestUtils.saveException(pageContext, e);
             throw e;
        }
        if( name!=null )
                handlers.append( name );
        handlers.append("[");
        handlers.append(iterateTag.getIndex());
                handlers.append("]");
        if( name!=null )
                handlers.append(".");
    }
View Full Code Here

        throws JspException {
        int index = 0;
        boolean found = false;

        // look for outer iterate tag
        IterateTag iterateTag =
            (IterateTag) findAncestorWithClass(this, IterateTag.class);

        // Look for JSTL loops
        if (iterateTag == null) {
            Integer i = getJstlLoopIndex();
            if (i != null) {
                index = i.intValue();
                found = true;
            }

        } else {
            index = iterateTag.getIndex();
            found = true;
        }

        if (!found) {
            // this tag should only be nested in iteratetag, if it's not, throw exception
View Full Code Here

        // if "indexed=true", add "index=x" parameter to query string
        // * @since Struts 1.1
        if( indexed ) {

           // look for outer iterate tag
           IterateTag iterateTag =
               (IterateTag) findAncestorWithClass(this, IterateTag.class);
           if (iterateTag == null) {
               // This tag should only be nested in an iterate tag
               // If it's not, throw exception
               JspException e = new JspException
                   (messages.getMessage("indexed.noEnclosingIterate"));
               TagUtils.getInstance().saveException(pageContext, e);
               throw e;
           }

           //calculate index, and add as a parameter
           if (params == null) {
               params = new HashMap();             //create new HashMap if no other params
           }
           if (indexId != null) {
            params.put(indexId, Integer.toString(iterateTag.getIndex()));
           } else {
              params.put("index", Integer.toString(iterateTag.getIndex()));
           }
        }

        String url = null;
        try {
View Full Code Here

TOP

Related Classes of org.apache.struts.taglib.logic.IterateTag

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.