Skip Headers

Oracle® Application Server 10g Multimedia Tag Library for JSP User's Guide and Reference
10g (9.0.4)
Part No. B10445-01
  Go To Documentation Library
Library
Go To Product List
Product
Go To Table Of Contents
Contents
Go To Index
Index

Previous Next  

A Installation and Configuration Information

This appendix provides information on installing and configuring Oracle Application Server 10g Multimedia Tag Library for JSP ("Multimedia Tag Library") within Oracle Application Server and other environments.

A.2 Installing Multimedia Tag Library

Multimedia Tag Library installation includes three components: a Java class library, a tag library descriptor (TLD) file, and the default media delivery component OrdGetMediaServlet. These three components are packaged in the ordjsptag.jar file.

You can install Multimedia Tag Library either when installing Oracle Application Server or after installing the standalone version of OC4J only. If you install Multimedia Tag Library as part of the installation for Oracle Application Server, the JAR file is automatically copied into the following OC4J directory:

<ORACLE_HOME>/j2ee/home/jsp/lib/taglib

To install Multimedia Tag Library after installing the OC4J standalone, follow the instructions on the Oracle Technology Network Web site at

http:///products/intermedia/content.html

A.3 Configuring Multimedia Tag Library

This section describes configuration parameters and deployment configurations that you may need to specify when deploying your application with Multimedia Tag Library.

A.3.1 Specifying the Virtual Path of the TLD File

The Multimedia Tag Library TLD file is included in the Multimedia Tag Library JAR file ( ordjsptag.jar). To use Multimedia Tag Library in a Web application JSP page, Web applications must specify the virtual path of the TLD file in the web.xml file for the Web application, as in the following example:

<taglib>
    <taglib-uri>
        intermedia-taglib.tld
    </taglib-uri>
    <taglib-location>
        http://xmlns.oracle.com/j2ee/jsp/tld/ordim/intermedia-taglib.tld
    </taglib-location>
  </taglib>

In the web.xml file the taglib-uri element is used to identify the tag library. The value of the taglib-uri element must match the value of the uri attribute for the JSP taglib directive in the JSP page for the Web application. The taglib-location element is used to locate the TLD file for the tag library. Its value is the URL where the TLD file is stored.

In the Web application JSP page that uses Multimedia Tag Library, enter the file name intermedia-taglib.tld as the value of the uri attribute for the JSP taglib directive.

A.3.2 Specifying the Media Delivery Component

Multimedia Tag Library provides two media delivery components, a media delivery servlet and a media delivery JSP page. You can specify the media delivery JSP page or use the media delivery servlet by default. Web applications can specify which media delivery component to use by defining the media-retrieval-path element in the tag library configuration file OrdJspTag.xml.

The media delivery servlet, oracle.ord.im.jsp.OrdGetMediaServlet, is packaged and installed with the tag library. It is the default media delivery component. Specify the virtual path to the servlet in the web.xml file for your Web application, similar to the following example:

<servlet>
    <servlet-name>oracle_ord_im_jsp_media_servlet</servlet-name>
    <servlet-class>oracle.ord.im.jsp.OrdGetMediaServlet</servlet-class>
</servlet>

 
  <servlet-mapping>
    <servlet-name>oracle_ord_im_jsp_media_servlet</servlet-name>
    <url-pattern>/OrdGetMediaServlet</url-pattern>
  </servlet-mapping>

The media delivery JSP page, OrdGetMediaJsp.jsp, can be downloaded from OTN. First, define the JSP page in the tag library configuration file. Then, copy it to the JSP directory for your Web application.

Using a JSP page to deliver media data is convenient because it requires no additional configuration beyond copying the supplied page into the application’s JSP page directory. For performance reasons, however, it might be desirable, or even necessary, to deliver media data from a servlet, rather than a JSP page.

A.3.3 Authorizing Access to Media Data

All Multimedia Tag Library actions that construct URLs also register table name and column name information within each user session. By default, the media delivery components verify this information when responding to a media retrieval request. If the verification check fails, media retrieval requests are rejected. Such verification ensures that malicious users cannot retrieve media data from any data source, table, or column using user-created URLs.

Some applications need to support general access to specific tables and columns. (For example: Applications where media URLs might be exchanged by users in mail messages might need such access to data.) For these applications, a mechanism is provided to allow anyone to access columns in tables in specific data sources. This mechanism involves setting the access-control attribute within the tag library configuration file OrdJspTag.xml.


Note:

To use this mechanism, applications must specify database connection information using a dataSourceName attribute in the tag.

A.3.4 Setting Cache Control Attributes

Multimedia Tag Library allows limited setting of cache control attributes. In this version, you can set the max-age, no-store, or no-store-remote directives of the Surrogate-Control header for all media retrieved from a particular named column in a specified table. The values of these directives are specified by the tag attributes expiration and cache.

The precise format for the expiration attribute is:

expiration_time[+removal_time]

where expiration_time is expressed as the time-to-live (TTL), and removal_time is the delay before the resource is removed from the cache after it expires.

Both values are specified in seconds (for example: 1800 or 10000+600).

The value of the cache attribute is no, no-remote, or yes. The values no and no-remote are translated into the no-store and no-store-remote directives in the Surrogate-Control header, respectively. The value yes means that the Web cache is used.

For more information on Oracle Web Cache, see media-cache-control-attributes in Chapter 3 and Oracle Application Server Web Cache Administrator's Guide .


Note:

Applications that require more fine-grained control over setting cache control attributes should design their own media delivery mechanism by replacing the default media delivery component. Or, avoid using Multimedia Tag Library for such applications.

A.3.5 Sample Configuration File

Here is an example of the tag library configuration file OrdJspTag.xml. This XML file is application-specific, therefore, place it in the same directory as the web.xml file for the Web application. The tag library configuration file is read at the first requirement and put into application context for further retrieval.

<?xml version="1.0" encoding="ISO-8859-1"?>
 
<!DOCTYPE ordim-tag-library [
<!ELEMENT ordim-tag-library (media-control?, media-access?, media-player*, media-retrieval-path?)> 
<!ELEMENT media-control (data-source?)>
<!ELEMENT data-Source (table+)>

<!ELEMENT table (column+)>
<!ELEMENT column (access-control)> 
<!ELEMENT access-control EMPTY>
<!ELEMENT media-access (access-unit+)>
<!ELEMENT access-unit EMPTY>
<!ELEMENT media-player (class-id)> 
<!ELEMENT class-id EMPTY>
<!ELEMENT media-retrieval-path (#PCDATA)> 
<!ATTLIST media-control filtering (true | false) #IMPLIED>
<!ATTLIST data-source name CDATA #REQUIRED>
<!ATTLIST table name CDATA #REQUIRED>
<!ATTLIST column name CDATA #REQUIRED>
<!ATTLIST access-control enabled (true | false) #REQUIRED>
<!ATTLIST access-unit name CDATA #REQUIRED>
<!ATTLIST access-unit dataSourceName CDATA #IMPLIED>
<!ATTLIST access-unit table CDATA #REQUIRED>
<!ATTLIST access-unit keyColumn CDATA #IMPLIED>
<!ATTLIST access-unit column CDATA #REQUIRED>
<!ATTLIST access-unit expiration CDATA #IMPLIED>
<!ATTLIST access-unit cache (yes|no|no-remote) #IMPLIED>
<!ATTLIST media-player name (mediaPlayer|realPlayer|quicktimePlayer) #REQUIRED>
<!ATTLIST class-id clsid CDATA #REQUIRED>
 ]>

<ordim-tag-library>
<media-control filtering="true">
  <data-source name="myMediaDataDS">
    <table name="public_photos">
      <column name="photo">
        <access-control enabled="false"/>
      </column>
      <column name="thumb">
        <access-control enabled="false"/>
      </column>
    </table>
    <table name="public_videos">
      <column name="movie">
        <access-control enabled="false"/>
      </column>
    </table>
  </data-source>
</media-control>
<media-access>
  <access-unit name="photoUnit" 
                 dataSourceName="myMediaDataDS" 
                 table="public_photos" 
                 keyColumn="ename" 
                 column="photo"
                 expiration="3600+60"/>

  <access-unit name="thumbUnit" 
                 dataSourceName="myMediaDataDS" 
                 table="public_photos" 
                 keyColumn="ename" 
                 column="photo"
                 expiration="3600+60"/>
  <access-unit name="movieUnit" 
                 dataSourceName="myMediaDataDS" 
                 table="public_videos" 
                 column="movie"
                 expiration="3600+60"
                 cache="no"/>
  <access-unit name="mp3Unit" 
                 table="musics" 
                 column="mp3"
                 expiration="3600+60"
                 cache="no"/>
</media-access>
<media-player name="mediaPlayer">
  <class-id clsid="22D6F312-B0F6-11D0-94AB-0080C74C7E95"/>
</media-player>
<media-retrieval-path>
  GetMediaServlet
</media-retrieval-path>
</ordim-tag-library>

The OrdJspTag.xml file provides the media retrieval tags with flexibility and simplicity. This file contains four elements: media-control, media-access, media-player, and media-retrieval-path.

The media-control element is used to control access to the media data. This element is optional. By default, all media data are allowed access only within the session when the media retrieval tags are used. However, to make the media data accessible to all clients outside the session, the application manager can set the enabled attribute of the access-control subelement to false.

The filtering attribute of the media-control subelement can be set to true. Doing so ensures that the media delivery component filters the special characters when HTML files are delivered to the browser.

The media-access element is used to define media access units, thus simplifying usage of the media retrieval tags. This element is optional. Each access-unit subelement defines a media access unit with a name and attributes that correspond to the following media retrieval tag common attributes: database-connection-attributes, table-and-column-attributes, and media-cache-control-attributes. The attributes defined in each media access unit can be overridden by the attributes defined in the media retrieval tag.

The media-player element defines the class identifier (clsid) used in the generated HTML <OBJECT> tag for the media player. This element is defined only when an application wants to use a specific media player in the Internet Explorer browser.

The media-retrieval-path element is used to specify the media delivery component used by Multimedia Tag Library. This element is defined only when an application wants to use a media delivery component other than the default media delivery component (OrdGetMediaServlet).