FileDocCategorySizeDatePackage
StrutsResourceLoader.javaAPI DocExample1883Mon Jul 23 13:26:52 BST 2007org.apache.struts2.views.velocity

StrutsResourceLoader

public class StrutsResourceLoader extends org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
Loads resource from the Thread's context ClassLoader.

Fields Summary
Constructors Summary
Methods Summary
public synchronized java.io.InputStreamgetResourceStream(java.lang.String name)

        if ((name == null) || (name.length() == 0)) {
            throw new ResourceNotFoundException("No template name provided");
        }

        if (name.startsWith("/")) {
            name = name.substring(1);
        }

        try {
            return ClassLoaderUtils.getResourceAsStream(name, StrutsResourceLoader.class);
        } catch (Exception e) {
            throw new ResourceNotFoundException(e.getMessage());
        }