Subversion Repositories general

Rev

Rev 961 | Blame | Compare with Previous | Last modification | View Log | RSS feed

/**
 * Extends and based on Apache Struts source code.
 *
 * Copyleft Anatoli Klassen (anatoli@aksoft.net)
 */
package ak.strutsx.taglib;

import javax.servlet.jsp.JspException;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.taglib.html.ErrorsTag;
import org.apache.struts.util.RequestUtils;

public class ErrorsIteratorTag
        extends ErrorsTag
{
    protected String id = null;

    public String getId()
    {
        return this.id;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public int doStartTag()
        throws JspException
    {
        ActionErrors errors = RequestUtils.getActionErrors(pageContext, name);

        if(errors != null)
                        pageContext.setAttribute(id, (property == null) ? errors.get() : errors.get(property));

        return EVAL_BODY_INCLUDE;
    }

    public void release()
    {
        super.release();

        id = null;
    }
}