JSP Tags for Embedding Reports

A report can be embedded in a Java Server Page (JSP) by using the custom tag library provided with this software. This integration approach provides maximum flexibility with minimal configuration.

demo
Read how InetSoft saves money and resources with deployment flexibility.

Configuring Style Intelligence for JSP Tags

To start using the Style Intelligence JSP tags, you have to place bisuite_pro.jar and etools.jar in the WEB-INF/lib directory of your web application. Then you will need to include the tag library definition in your web application descriptor, web.xml, which is located in the WEB-INF directory of your web application. Simply add the following XML content to the file:

 <taglib>
 <taglib-uri>sree.tld</taglib-uri>
 <taglib-location>/WEB-INF/lib/bisuite_pro.jar
 </taglib-location>
 </taglib>

If your registry directory is a directory other than the WEB-INF/classes directory, you will need to include an initialization parameter as well:

 <context-param>
 <param-name>sree.home</param-name>
 <param-value>/path/to/your/registry/directory</param-value>
 </context-param>

The value of this parameter is the same as the one you would use to set up the Servlet Repository. In certain application servers, it is impossible to serve binary data through a JSP. The resources will fail to load and an exception will appear. To avoid this, a servlet, inetsoft.sree.web.jsp.ResourceServlet, is provided to serve binary resources. If you encounter this problem, register the servlet and specify the servlet's URI in the resourceUri attribute of the sree:create tag.

No additional configuration is needed in your web application. You are now ready to start writing JSP pages.

Tag Library Import

In order to use Style Intelligence tags in a JSP page, you need to import the tag library. This is done by using a JSP taglib directive:

 <%@taglib uri="sree.tld" prefix="sree"%>

This tells the JSP that all tags that start with “<sree:” refer to the tag library defined in the web.xml file with the URI of sree.tld. The prefix is an XML namespace prefix. This means that any tag included in the page needs to be prefixed with “sree:”. This prevents naming collisions if another tag library has a tag of the same name.

Cache Tag

The first tag that must be included in the JSP is the “cache” tag. Use the cache tag when you have multiple reports on the same JSP page, and want to refresh one report without regenerating the others (i.e., the others should be displayed from the cache). The cache tag has a single required attribute, jspId, which needs to be unique for the whole web application. This means that no JSPs may have a cache tag with the same jspId. There is one cache tag for the entire JSP page.

<sree:cache jspId="reportJSP"/>