Windward Reports Servlet Example
This is a basic example on how to use the Windward Reports Java engine in a web application.
This example is a pure servlet implementation (no JSPs or EJBs).
You are free to use this sample in any way you wish. The instructions are for Windows systems, but the setup
process is very similar for any other system that Tomcat supports.
There are two front-end sites for this example.
-
The first is static, where you are looking at information on a specific employee. There is a single
button to generate a report for that individual.
-
The second one is more dynamic. You choose which leave request number you want the report to be on and
the output format.
Installation of Tomcat - (all links assume you are running on localhost)
-
First, install the Java SE JDK
Either the 32 or 64 bit version will work.
-
Setup environment variable JAVA_HOME (point this to the root installation of your Java installation; for example "C:\Program Files\Java\jdk1.6.0_23").
-
Download the ZIP file for Tomcat 6.0
and NOT THE WINDOWS INSTALLATION. The code in Tomcat that runs the windows service does not work.
-
Extract the ZIP file to a directory on your system, IE C:\tomcat6.
-
Startup Tomcat: Go to C:\tomcat6\bin from a command prompt and run 'startup.bat'.
-
Open a web browser and navigate to http://localhost:8080.
If you see the Tomcat webpage, you have successfully installed Apache Tomcat.
-
If Tomcat is not running on your local computer, change "localhost" to the name of
the remote computer's name.
-
Shutdown Tomcat: Go to C:\tomcat6\bin from a command prompt and run 'shutdown.bat'.
-
Follow the directions below to setup the Windward Reports Java Servlet example.
Setup Windward Java Servlet on Tomcat
-
Copy the contents of the example 'htmlhelp\examples\ServletExample' into the 'C:\tomcat6\webapps\ServletExample folder'.
You will end up with the following items in 'C:\tomcat6\webapps\ServletExample':
- 'files' folder
- 'images' folder
- 'META-INF' folder
- 'src' folder (contains the source code for this example)
- 'WEB-INF' folder
- 'index.html' file
- 'ServletExample.iml' file (IntelliJ project file)
- 'ServletExample.ipr' file (IntelliJ project file)
- 'ServletExample.iws' file (IntelliJ project file)
-
If you did not enter your license key during the install or you installed using the ZIP file, copy and paste your Java Engine key into the 'C:\tomcat6\webapps\ServletExample\WEB-INF\WindwardReports.properties' file.
(The key already in the WindwardReports.properties file is not valid).
- Startup Tomcat: Go to 'C:\tomcat6\bin' from a command prompt and run 'startup.bat'.
Testing the sample
- Once you have done all that go to http://localhost:8080/ServletExample/ and you should see the servlet.
- Click here to go to the first example.
- Click here to go to the second example.
Notes
- All of the source code calling the Windward Java Engine can be found at 'C:\tomcat6\webapps\ServletExample\src'.
- To build from the source, either
- Run build.bat in the 'c:\tomcat6\webapps\ServletExample\src\com\windwardreports' directory. NOTE: You will need to have javac.exe in your PATH or specify the full path location in build.bat.
- Open the ServletExample.ipr in IntelliJ and build the project using the UI.