org.jafer.servlet.xslt
Class XSLTRequestDispatcher

java.lang.Object
  extended by org.jafer.servlet.xslt.XSLTRequestDispatcher
All Implemented Interfaces:
javax.servlet.RequestDispatcher

public class XSLTRequestDispatcher
extends java.lang.Object
implements javax.servlet.RequestDispatcher


Field Summary
private  javax.servlet.ServletContext context
           
private static javax.xml.parsers.DocumentBuilder domBuilder
           
private  java.util.Map localeResources
           
private  javax.xml.transform.Templates templates
           
private static java.util.Map templatesMap
           
private static javax.xml.transform.TransformerFactory transformerFactory
           
 
Constructor Summary
XSLTRequestDispatcher(javax.servlet.ServletContext context, java.lang.String xslUrl)
           
XSLTRequestDispatcher(javax.servlet.ServletContext context, java.lang.String xslUrl, java.lang.String resource)
           
XSLTRequestDispatcher(javax.servlet.ServletContext context, java.lang.String xslUrl, java.lang.String resource, java.util.Locale locale)
           
XSLTRequestDispatcher(javax.servlet.ServletContext context, java.lang.String xslUrl, java.lang.String resource, java.lang.String locale)
           
 
Method Summary
private  void constructor(javax.servlet.ServletContext context, java.lang.String xslUrl, java.lang.String resource, java.util.Locale locale)
           
 void forward(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
          Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server.
private  java.util.Map getLocaleResources(java.lang.String resourceName, java.util.Locale locale)
           
 void include(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
          Includes the content of a resource (servlet, JSP page, HTML file) in the response.
private  void processXSLT(javax.servlet.ServletResponse response, org.w3c.dom.Document xml, java.util.Map xslParams, java.util.Map urlParams)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transformerFactory

private static javax.xml.transform.TransformerFactory transformerFactory

domBuilder

private static javax.xml.parsers.DocumentBuilder domBuilder

templatesMap

private static java.util.Map templatesMap

context

private javax.servlet.ServletContext context

localeResources

private java.util.Map localeResources

templates

private javax.xml.transform.Templates templates
Constructor Detail

XSLTRequestDispatcher

public XSLTRequestDispatcher(javax.servlet.ServletContext context,
                             java.lang.String xslUrl)
                      throws javax.xml.transform.TransformerConfigurationException
Throws:
javax.xml.transform.TransformerConfigurationException

XSLTRequestDispatcher

public XSLTRequestDispatcher(javax.servlet.ServletContext context,
                             java.lang.String xslUrl,
                             java.lang.String resource)
                      throws javax.xml.transform.TransformerConfigurationException
Throws:
javax.xml.transform.TransformerConfigurationException

XSLTRequestDispatcher

public XSLTRequestDispatcher(javax.servlet.ServletContext context,
                             java.lang.String xslUrl,
                             java.lang.String resource,
                             java.lang.String locale)
                      throws javax.xml.transform.TransformerConfigurationException
Throws:
javax.xml.transform.TransformerConfigurationException

XSLTRequestDispatcher

public XSLTRequestDispatcher(javax.servlet.ServletContext context,
                             java.lang.String xslUrl,
                             java.lang.String resource,
                             java.util.Locale locale)
                      throws javax.xml.transform.TransformerConfigurationException
Throws:
javax.xml.transform.TransformerConfigurationException
Method Detail

constructor

private void constructor(javax.servlet.ServletContext context,
                         java.lang.String xslUrl,
                         java.lang.String resource,
                         java.util.Locale locale)
                  throws javax.xml.transform.TransformerConfigurationException
Throws:
javax.xml.transform.TransformerConfigurationException

forward

public void forward(javax.servlet.ServletRequest request,
                    javax.servlet.ServletResponse response)
             throws javax.servlet.ServletException,
                    java.io.IOException
Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server.

Specified by:
forward in interface javax.servlet.RequestDispatcher
Parameters:
request - a ServletRequest object that represents the request the client makes of the servlet
response - a ServletResponse object that represents the response the servlet returns to the client
Throws:
javax.servlet.ServletException - if the target resource throws this exception
java.io.IOException - if the target resource throws this exception

include

public void include(javax.servlet.ServletRequest request,
                    javax.servlet.ServletResponse response)
             throws javax.servlet.ServletException,
                    java.io.IOException
Includes the content of a resource (servlet, JSP page, HTML file) in the response.

Specified by:
include in interface javax.servlet.RequestDispatcher
Parameters:
request - a ServletRequest object that contains the client's request
response - a ServletResponse object that contains the servlet's response
Throws:
javax.servlet.ServletException - if the included resource throws this exception
java.io.IOException - if the included resource throws this exception

getLocaleResources

private java.util.Map getLocaleResources(java.lang.String resourceName,
                                         java.util.Locale locale)

processXSLT

private void processXSLT(javax.servlet.ServletResponse response,
                         org.w3c.dom.Document xml,
                         java.util.Map xslParams,
                         java.util.Map urlParams)
                  throws java.lang.Exception
Throws:
java.lang.Exception