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:
run on a wider variety of client machines and browsers.
run on thinner clients, thereby consuming fewer client-machine resources.
scale to a larger number of simultaneous users.
require less effort to install and maintain.
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
.
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>
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:
REP-6106
or REP-6104
with javax.servlet.jsp.JspException
(multibyte)
REP-0495 Unable to tokenize the query (singlebyte)
REP-0069 Internal Error
or REP-6106
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:
<%@ page contentType="text/html;charset=EUC-JP" %>
<META http-equiv="Content-Type" content="text/html;charset=EUC-JP">
This JSP file needs to be encoded in the character set (EUC-JP
).
NLS_LANG=JAPANESE_JAPAN.JA16EUC
In this example, the JSP-based Web report's encoding (EUC-JP
)
matches Reports Builder's character set portion of NLS_LANG
,
that is, JA16EUC
.
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:
Edit the rw*.html
files and the blank_template.jsp
file, as follows:
Modify the page directive to read:
<%@ page contentType="text/html;charset=yourIANAencoding"
%>
where:
yourIANAencoding
is the IANA encoding name that
corresponds to the NLS_CHARACTERSET
portion of the NLS_LANG
variable.
Modify the <Meta>
tag inside the <Head>
tag to read:
<meta http-equiv="Content-Type"
content="text/html;charset=yourIANAencoding" />
Edit the template.xsl
(ORACLE_HOME/reports/templates/
)
file, as follows:
Modify the <xsl:output>
tag to read:
<xsl:output
method="jsp"
indent="yes"
encoding="yourIANAencoding"
/>
where:
yourIANAencoding
is the IANA encoding name that
corresponds to the NLS_CHARACTERSET
portion of the NLS_LANG
variable.
Add the page directive to the file:
<%@ page contentType="text/html;charset=yourIANAencoding"
%>
Add or modify the <META>
tag inside the <HEAD>
tag:
<meta http-equiv="Content-Type"
content="text/html;charset=yourIANAencoding" />
where:
yourIANAencoding
is the IANA encoding name that
corresponds to the
NLS_CHARACTERSET
portion of the NLS_LANG
variable.
Copyright © 1984, 2005, Oracle. All rights reserved.