These are basic steps you need to do for integration with Jasper JSP provider
Tomcat 5.5.x
- Download Apache Tomcat sources from
http://tomcat.apache.org/download-55.cgi
- Extract jasper subdirectory from a source archive
- Download Apache commons
EL and
Logging unless you have them already. Only binaries are required. If you
do not use commons for something else, then you can copy commons-el.jar
and commons-logging-1.1.jar under dependlib directory inside
jasper (the directory needs to be created)
- Copy .java files under TJWS distribution which are in src/jasper
directory to corresponding place of jasper/src/share directory
(accordingly package name)
- Remove or rename with different extension AntCompiler.java,
and JDTCompiler.java in jasper/src/share under package org.apache.jasper.compiler
- Copy .xml files from TJWS distribution src/jasper to jasper
directory
- Edit copied env.xml providing correct paths for variables SERVLET_HOME, JSP_HOME,
and commons libraries (7Bee expression 'CUSTOM CP')
- Download and install
7Bee unless you already have it (it's worth to check for a fresh version
though)
- Launch bee and get jasper.jar built. You will find it in build
directory.
- Distribution of TJWS is already pre-configured to be integrated with
Jasper, so if you provide correct paths in env.xml of TJWS to Jasper
libraries, then you can start using it out of the box. Check with TJWS
documentation how to specify additional init parameters for JSP servlets,
like Jasper. If you use a start script for launching TJWS, then the
following Jasper parameters you may add:
-j org.apache.jasper.servlet.JspServlet -org.apache.jasper.servlet.JspServlet.classpath
%classpath% -org.apache.jasper.servlet.JspServlet.scratchdir %deploydir%/WEB-INF
Using Jasper from Tomcat 6.0.x (JSP 2.1)
- Download Apache Tomcat sources from
here. Sources only.
- Extract downloaded archive in some directory.
- Prune Tomcat and JSDK related classes in apache-tomcat-6.0.x-src/java folder, the
following packages have to remain
- javax.el
- javax.servlet.jsp
- javax.servlet.resources
- javax.servlet and all subpackages of it (optional unless
you do not have a separate JSDK)
- org.apache
- org.apache.el and all subpackages of it
- org.apache.juli and all subpackages of it
- org.apache.jasper and all packages of it
- Remove or rename with different extension AntCompiler.java, and
JDTCompiler.java in apache-tomcat-6.0.x-src/java under package org.apache.jasper.compiler
- Copy *.java files under TJWS distribution which are in src/jasper6 directory
to corresponding place of apache-tomcat-6.0.x-src/java directory (accordingly package
name). The files may overwrite existing Jasper classes.
- Copy .xml files from TJWS distribution src/jasper6 to tomcat-6.0.x-src
directory
- Edit env.xml providing correct paths for variables SERVLET_HOME
unless you preserved all subpackages of javax.servlet
- Follow steps 8-10 of the previous section. Note that extra EL and LOG libraries
are not required for build and use Jasper from Tomcat 6.x.
Using Jasper from Tomcat 7.0.x (JSP 2.3)
Unfortunately Tomcat team did worse job and tied Jasper more with rest of Tomcat code.
So generally you should follow Jasper 6.0.x instructions with the following changes:
Using Jasper from Tomcat 7.0.6x (JSP 2.3)
More files are required from org.apache.tomcat.util. Add classes from this directory and also the following subdirectories:
descriptor
digester
file
res
scan
security
The rest is similar as for previous builds, however use overwriting content from jasper7-6x.
Using Jasper from Tomcat 7.0.7x (JSP 2.3)
More files are required from org.apache.tomcat.util. Add classes from this directory and also the following subdirectories:
buf
The rest is similar as for previous builds, however use overwriting content from jasper7-7x.
Using Jasper from Tomcat 8.0.x
The procedure is a similar to previous versions of Tomcat.
Using Jasper from Tomcat 9.0.x
Directory /1.x/src/jasper9 provides required resources to patch. The process is similar to previous versions of Jasper.
First, you need to downloaded Tomcat 9 sources from Apache Tomcat site.
It's recommended to create jasper target directory and copy only required content there. Directoriy structures have to be preserved if they are copied.
Result directories structure is defined in 85/all-files.txt. Files to patch are:
- BeeCompiler.java
- 85/JspC.java
- 85/JspCompilationContext.java
- 85/LogFactory.java
Build scripts: bee-jasper.xml and env.xml are copied in the root of the target directory.
jasper.jar will be found in build directory after running 7Bee script using command: bee