File: README.servlet

package info (click to toggle)
libxalan2-java 2.7.1-5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 19,468 kB
  • ctags: 26,006
  • sloc: java: 175,784; xml: 28,073; sh: 164; jsp: 43; makefile: 43; sql: 6
file content (66 lines) | stat: -rw-r--r-- 2,576 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
=======================================================================
CONTENTS OF THIS DOCUMENT:

  o) HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE
  o) HOW TO INVOKE TRANSLETS FROM A SERVLET
  o) TIPS FOR RUNNING THE SAMPLE ON TOMCAT

-----------------------------------------------------------------------
HOW TO PROVIDE XSL TRANSFORMATIONS AS A WEB SERVICE

With XSLTC, XSL transformations can be run from within a servlet. 
This sample code demonstrates how that can be implemented.

The CompiledEJB and CompiledBrazil sample code demonstrate other 
aproaches to providing XSL transformations as a web service.

-----------------------------------------------------------------------
HOW TO INVOKE TRANSLETS FROM A SERVLET

The CompiledServlet directory contains the example source code:

    TransformServlet.java

This file contains a minimal implementation of an XSL transformation 
servlet.  When you deploy your servlet, make sure that the XSLTC
TransformerFactory will be used by either setting the system property
"javax.xml.transform.TransformerFactory" with the value
"org.apache.xalan.xsltc.trax.TransformerFactoryImpl", or by making a
file with the name "META-INF/services/javax.xml.transform.TransformerFactory"
containing the single line

  org.apache.xalan.xsltc.trax.TransformerFactoryImpl

available on your CLASSPATH.

-----------------------------------------------------------------------
TIPS FOR RUNNING THE SAMPLE ON TOMCAT

When compiling the java files supplied with the sample, you need to 
add xalan.jar, xml-apis.jar, xercesImpl.jar and servlet.jar 
(in %Tomcat_Home%/common/lib) to the classpath

o Copy the latest xalan.jar to %Tomcat_Home%/common/endorsed
  
o Create a JAR file containing your translet classes and a file
   named META-INF/services/javax.xml.transform.TransformerFactory in
   your JAR file that contains the following line:

       org.apache.xalan.xsltc.trax.TransformerFactoryImpl

o Copy the JAR file, xalan.jar, xercesImpl.jar and xml-apis.jar to your
  Web_application_context/WEB-INF/lib 

o Make sure that the value of the "class" parameter is the same as
  the name of the translet .class or a valid xsl URI

o Make sure that the value of the "source" parameter is a valid 
  xml URI

o Make sure that the value of the "sheet" parameter is a valid
  xsl URI

o The translet .class generated by CompiledServlet will be placed 
  under %Tomcat_Home%/bin/ 
-----------------------------------------------------------------------
END OF README