org.apache.fop.servlet

Class ServletContextURIResolver

Implemented Interfaces:
URIResolver

public class ServletContextURIResolver
extends java.lang.Object
implements URIResolver

This class is a URIResolver implementation that provides access to resources in the WEB-INF directory of a web application using "servlet-content:" URIs.

Field Summary

static String
SERVLET_CONTEXT_PROTOCOL
The protocol name for the servlet context URIs.

Constructor Summary

ServletContextURIResolver(ServletContext servletContext)
Main constructor

Method Summary

Source
resolve(String href, String base)
protected Source
resolveServletContextURI(String path)
Resolves the "servlet-context:" URI.

Field Details

SERVLET_CONTEXT_PROTOCOL

public static final String SERVLET_CONTEXT_PROTOCOL
The protocol name for the servlet context URIs.

Constructor Details

ServletContextURIResolver

public ServletContextURIResolver(ServletContext servletContext)
Main constructor
Parameters:
servletContext - the servlet context to access the resources through

Method Details

resolve

public Source resolve(String href,
                      String base)
            throws TransformerException

resolveServletContextURI

protected Source resolveServletContextURI(String path)
            throws TransformerException
Resolves the "servlet-context:" URI.
Parameters:
path - the path part after the protocol (should start with a "/")
Returns:
the resolved Source or null if the resource was not found

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.