A script-enabled browser is required for this page to function properly.

About JavaServer Pages (JSPs) and servlets

Following the introductory paragraphs about JSP technology, this topic contains information specific to JSP-based Web reports in the following sections:

JavaServer Pages (JSPs) technology is an extension to the Java servlet technology from Sun Microsystems that provides a simple programming vehicle for displaying dynamic content on a Web page. A JSP is an HTML page with embedded Java source code that is executed in the Web server or application server. The HTML provides the page layout that is returned to the Web browser, and Java provides the business logic.

JSPs keep static page presentation and dynamic content generation separate. Because JSPs cleanly separate dynamic application logic from static HTML content, Web page designers who have limited or no Java programming expertise can modify the appearance of the JSP page without affecting the generation of its content, simply using HTML or XML tags to design and format the dynamically-generated Web page. JSP-specific tags or Java-based scriptlets can be utilized to call other components that generate the dynamic content on the page.

JSPs have the .jsp extension. This extension notifies the Web server that the page should be processed by a JSP container. The JSP container interprets the JSP tags and scriptlets, compiles the JSP into a Java servlet and executes it, which generates the content required, and sends the results back to the browser as an HTML or XML page.

A JSP can be accessed and run from a browser-based client, typically over the Internet or a corporate intranet. Unlike traditional client/server applications, JSP applications:

When a JSP is called for the first time, it is compiled into a Java servlet class and stored in the Web server's memory. Because it is stored in memory, subsequent calls to that page are very fast, thereby avoiding the performance limitations seen with traditional Common Gateway Interface (CGI) programs, which spawn a new process for each HTTP request. Each initializes a JVM, which results in a slow performance when running a large number of report requests. Thus, Oracle strongly recommends that you use Reports Servlet (rwservlet) instead of Reports CGI (rwcgi) to deploy your reports to the Web.

For additional background information about JSP technology, see the Sun Microsystems Java and J2EE Web site at http://java.sun.com.

Using JSPs in Oracle Reports

Oracle Reports supports JavaServer Pages (JSPs) as the underlying technology to enable you to enhance Web pages with information retrieved using Reports Builder.  

In Oracle Reports, you use JSPs to embed data retrieved using the data model into an existing Web page to create a JSP-based Web report. You can create new JSP reports, or save existing reports as JSP reports. New reports are by default saved as a JSP reports. The benefit of saving reports as JSPs is that JSPs are text files that are easy to edit as opposed to, for example, the binary .rdf format. When a report is saved as a JSP file, the data model is embedded using XML tags. The entire report can now be defined using XML tags and saved as an XML file.

Using the Oracle Reports custom JSP tags, you can easily add report blocks and graphs to existing JSP files. These tags can be used as templates to enable you to build and insert your own data-driven Java component into a JSP-based Web report. Not only can you edit the HTML or XML code that encapsulates the report block, but you can also edit the report block in the JSP itself, by modifying, adding or deleting their bodies and attributes.

The Report Editor's Web Source view displays the source code for your Web report, including HTML, XML, and JSP tags.

By default, a new JSP created in Reports Builder contains the following:
<%@ page contentType="text/html;charset=ISO-8859-1" %>
If you are creating your JSP outside Reports Builder, you should ensure that it contains similar encoding information.

In prior releases, Oracle Reports introduced Web links that you can add to paper-based reports, which become active when you display your paper report in a Web browser or PDF viewer. For JSP-based Web reports, hyperlinks have to be created manually, and if the hyperlinks need to substitute data values, the data values must be provided with the rw:field JSP tag. For example:

<a href="http://server/path/rwservlet?report=department.jsp&p_deptno=<rw:field id="F_Deptno" src="Deptno"/>">
<rw:field id="F_Deptno" src="Deptno">10</rw:field>
</a>

Opening or running an encoded JSP-based Web report

If your JSP-based Web report's character encoding (for example, EUC-JP) differs from the character set portion of the NLS_LANG environment variable (for example, JA16SJIS), you will get the following errors:

To work around this issue, you must ensure that your JSP-based Web report's character encoding matches the IANA encoding corresponding to Reports Builder's character set portion of the NLS_LANG environment variable.

For example:

Embedding a character set in a JSP file dynamically

In Oracle Reports, Web report templates are configured for Western European character encoding by default. However, for other languages, you can specify the character encoding for every JSP file by using both the charset attribute of the <Meta> tag and the <%@page%> page directive.

To dynamically associate the appropriate character encoding with the JSP file, you can make the following modifications:

  1. Edit the rw*.html files and the blank_template.jsp file, as follows:

  2. Edit the template.xsl (ORACLE_HOME/reports/templates/) file, as follows:

See also

About Web reports

Oracle Reports XML tags

About JSP tags

Oracle Reports JSP tags