The Think Tank devoted to your internet needs.
We provide internet solutions that will save you both time and money.
Home  
    
Services  
    
AThinkStats  
    
Resources  
    
Partners  
    
Contact Us  
    
Sitemap  
    

Valid XHTML 1.1!

Valid CSS!

When we set out to deploy a dynamic site on Tomcat 5.5, we did not run into this issue right away. Once we did, tracking down the solution took for ever. These notes pertain to Java 5, Tomcat 5.5, and Xalan

If you are interested in a jar with all of the code neatly done in a sample war, let us know. info .@. athinktank .dot. com

The solution came when we learned of the systemId that needed to be set on the StreamSource

		URL fileURL = this.context.getResource("/WEB-INF/xsl/myxsl.xsl");
		String systemId = fileURL.toExternalForm(  );
		StreamSource streamSource = new StreamSource(systemId);
		TransformerFactory tFactory = TransformerFactory.newInstance();
		transformer = tFactory.newTransformer(streamSource);
	
Once this is done, then the transformation factory will be able to determine where your xsl lives and where to relatively include either your xsl:import or your xsl:include No more tomcat5/bin or tomcat/bin errors. A word of warning. If you do use this with tomcat 5.5, and you throw this into the init() of the servlet, and you're xsl sheet is buggy, the error will get swallowed up and no exception will be thrown (atleast for me). I was getting a null pointer exception (NPE) so watch out.