JavaServer Pages[tm] (JSP[tm]) Technology Migration from
iPlanet [tm] Application Server, Enterprise Edition 6.0 Service Pack 2 to
Later Versions
by Matthew Hosanee
(June 2002)
We want to hear from you! Please send us your
FEEDBACK.
The following article/tutorial may contain actual software programs in source
code form. This source code is made available for developers to use as needed,
pursuant to the terms and conditions of this license.
Overview
Starting with the release of iPlanet[tm] Application Server ("iAS") Enterprise Edition
6.0 service pack 3, the native JavaServer Pages[tm] (JSP[tm]) compiler was migrated
to Apache's Jasper
JSP compiler. This compiler, which is based on Tomcat 3.2.1, is compliant
with the JSP 1.1 specification.
Currently the Jasper JSP compiler is integrated into iAS Enterprise Edition 6.0 service
packs 3 and 4, and also into iAS Enterprise Edition 6.5.
The previous JSP compiler was fairly lenient with regard to the specification
and case sensitivity. One issue is the use of the subelement <rtexprvalue>
of the <attribute> element in the XML Tag Library Descriptor
of a Tag Extension. This subelement signifies whether the value of
the attribute may be dynamically calculated at runtime by a scriptlet expression.
For example, the following JSP sets the value of "sayThis". There
are two ways to parse the value - either as a string or as an expression to
be resolved during the generation of the response.
<MyTags:test
sayThis="<%=(String)session.getAttribute("lang")%>"
/>
The original JSP compiler allowed dynamic calculation of the scriptlet
expression regardless of whether <rtexprvalue> was set.
An example output would be:
eu
In service pack 3 and later, this would show the scriptlet expression
as a string by default, outputting:
<%=(String)session.getAttribute("lang")%>
If the <rtexprvalue> is set to "true" in the Tag
Library Descriptor XML file, the expression is evaluated. For
example:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library
1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlibversion>1.1</tlibversion>
<shortname></shortname>
<tag>
<name>test</name>
<tagclass>MyTagTest</tagclass>
<bodycontent>EMPTY</bodycontent>
<info>Outputs a passed string</info>
<attribute>
<name>sayThis</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>
As mentioned previously, there are a few issues to be aware of with the
migration to the new parser. The above example just demonstrates one
issue that may arise. Although the new parser is strict in following
the specification with regard to case sensitivity, by using the
following 'methods' it is possible to return the
Application Server to the old behaviour without modification to the code:
- allow the case-sensitivity to be relaxed
- allow the use of the old JSP compiler
These are documented in the service pack 3 release notes (as linked in
the Resource section of this article), although it is recommended that you update
the code as
per the JSP specifications for portability and for future releases.
Resources
See the service pack 3 release notes here for further information regarding
the Jasper integration and backward compatability:
http://docs.iplanet.com/docs/manuals/ias/60/sp3/rn_sp3.html
The Java[tm] WebServices tutorial
http://java.sun.com/webservices/tutorial.html
The JSP 1.1 specification can be downloaded from
http://java.sun.com/products/jsp/download.html
The JSP 1.1 DTD can be found at
http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
The main JSP tag libraries page is at
http://java.sun.com/products/jsp/taglibraries.html
|