Deploying Report WAR Files to Any Web Server

When not using the Enterprise Manager, it is possible to create WAR files manually. After a WAR file is created, it can be deployed in any web server which supports the servlet 2.2 specification and allows WAR files to be used for deployment.

The procedures for creating and deploying a WAR file in these servers are documented in this appendix. If you have a server that supports WAR files and is not covered in this section, or if there is any discrepancy between the instructions in this document and in the application server document, please refer to the documentation of the web server to find detailed instructions for deploying WAR files.

A WAR file is a regular JAR file with a special directory structure. The root directory of the archive file serves as the document root for serving files that are part of the application. A special directory, WEB-INF, contains all servlet JAR files, class files, and resources.

#1 Ranking: Read how InetSoft was rated #1 for user adoption in G2's user survey-based index Read More

  /WEB-INF/lib/{JAR files   used by servlet}
  /WEB-INF/classes/{Class   files used by servlet}

Mixing JAR files and class files may be problematic in some servlet runtime implementations. Therefore, we recommend packaging all class files into JAR files, and then placing them in the /WEB-INF/lib directory.

Once a WAR file is created, it can be deployed in a Servlet runtime environment. The actual procedure for deploying a WAR file is slightly different across different implementations. Detailed instructions for some typical environments appear in the next few chapters.

Example: WAR File Creation  >>

1. Create a root directory to hold the files. In this example, we create a directory in c:\temp called 'sree'.

2. Create the following sub-directories in c:\temp\sree:


3. Create an HTML entry screen in the root directory. As an example you can use the default login screen; simply copy the 'index.html' and 'logo.gif' files from the existing installation's webapps\sree and webapps\sree\images directories, respectively, and paste these files into the new c:\temp\sree directory.

4. Copy the SREE runtime JAR files to the c:\temp\sree\WEB-INF\lib directory. The required JAR files are:

  sree_pro.jar, or   alternates:
Read how InetSoft saves money and resources with deployment flexibility.

5. Create a JAR file to contain all of the replet class files in your report application. The JAR file should also contain all resource files, such as the report template XML files and the data files. For example, to cre­ate a JAR file for all of the replets in a given directory, navigate to the desired directory, and then run the following:

jar cf guide.jar   replets\*.class replets\*.srt replets\*.txt

6. Copy the replet JAR file 'guide.jar' to c:\temp\sree\WEB-INF\lib.

7. Copy the configuration file, '', to c:\temp\sree\WEB-INF\classes.

8. Copy the 'repository.xml' file to c:\temp\sree\WEB-INF\classes. The file name may be different depending on the property value of the 'replet.repository.file' in ''.

9. If your application uses the default security implementation of SREE, copy both the 'acl.xml' and 'passwd.xml' files to c:\temp\sree\WEB-INF\classes. The file names may be different depending on the prop­erty values of 'security.password.file' and 'security.acl.file'.

Learn about the top 10 features of embedded business intelligence.

10. Create a 'web.xml' file in the WEB-INF directory. The 'web.xml' file should be in standard web deployment descriptor format. The follow­ing is an example of the descriptor file:

 <?xml version="1.0"   encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems,  Inc.//DTD Web Application 2.3//EN" "">

   <servlet-class>inetsoft.sree.web.ServletRepository</   servlet-class> </servlet> <servlet>    <servlet-name>manager</servlet-name>

   <servlet-class>inetsoft.sree.adm.AdmServlet</servlet-   class> </servlet> <servlet> <servlet-name>DataServlet</servlet-name>    <servlet-class>DataServlet</servlet-class>

</servlet> <servlet-mapping>    <servlet-name>replets</servlet-name>    <url-pattern>/Reports</url-pattern> </servlet-mapping>


   <servlet-name>manager</servlet-name>    <url-pattern>/EnterpriseManager</url-pattern>

</servlet-mapping> <servlet-mapping>    <servlet-name>DataServlet</servlet-name> <url-pattern>/DataServlet</url-pattern> </servlet-mapping> </web-app>
Learn about the top 10 features of embedded business intelligence.

11. Create the WAR file as follows:

   cd c:\temp\sree

jar cf guide.war index.html logo.gif WEB-INF

These steps can be placed in a shell script or a makefile, and can then be performed as part of the application building process.

Previous: Miscellaneous Report Properties