Running the Viewer
Our sample projects and report templates can help you learn the basics of working with our products.The web viewer is added to a JSP page with the Stimulsoft tag library, after registering its servlets in
Register the servlets. In
How it works. The JSP renders the report server-side and hands it to the viewer tag, while the servlets serve resources and process viewer requests.
web.xml.Register the servlets. In
web.xml:<servlet>
<servlet-name>StimulsoftResource</servlet-name>
<servlet-class>com.stimulsoft.web.servlet.StiWebResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>StimulsoftResource</servlet-name>
<url-pattern>/stimulsoft_web_resource/*</url-pattern>
</servlet-mapping>
<!-- plus StiWebViewerActionServlet mapped to /stimulsoft_webviewer_action -->Render a report and place the viewer tag. In the JSP:StiReport report = StiSerializeManager.deserializeReport(new File(reportPath));
report.render();
StiWebViewerOptions options = new StiWebViewerOptions();
pageContext.setAttribute("report", report);
pageContext.setAttribute("options", options);
// <stiwebviewer:webviewer report="${report}" options="${options}" />StiWebResourceServlet+StiWebViewerActionServlet— serve the viewer's static resources and handle its AJAX actions.<stiwebviewer:webviewer report options />— the tag that renders the viewer for the prepared report.
How it works. The JSP renders the report server-side and hands it to the viewer tag, while the servlets serve resources and process viewer requests.