Example usage for org.apache.commons.jelly JellyTagException setFileName

List of usage examples for org.apache.commons.jelly JellyTagException setFileName

Introduction

In this page you can find the example usage for org.apache.commons.jelly JellyTagException setFileName.

Prototype

public void setFileName(String fileName) 

Source Link

Document

Sets the Jelly file which caused the problem

Usage

From source file:com.cyclopsgroup.waterview.utils.TagSupportBase.java

/**
 * Overwrite or implement method doTag()
 *
 * @see org.apache.commons.jelly.Tag#doTag(org.apache.commons.jelly.XMLOutput)
 *//*from  www.  j  a  v a2  s.  co m*/
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException {
    try {
        processTag(output);
    } catch (Exception e) {
        JellyTagException ex = null;
        if (e instanceof JellyTagException) {
            ex = (JellyTagException) e;
        } else {
            ex = new JellyTagException(e);
        }
        URL[] scriptResources = getScriptResources();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < scriptResources.length; i++) {
            URL url = scriptResources[i];
            sb.append(">").append(url.toString());
        }
        ex.setFileName(sb.toString());
        throw ex;
    }
}