Code Listing 1: Using the OrdHttpJspResponseHandler within a JSP

<%@ page language="java" %>

<%@ page import="OrdSamplePhotoAlbumBean" %>
<%@ page import="oracle.ord.im.OrdHttpJspResponseHandler" %>

<jsp:useBean id="photos" scope="page" 

             class="OrdSamplePhotoAlbumBean"/>
<jsp:useBean id="handler" scope="page"
             class="oracle.ord.im.OrdHttpJspResponseHandler"/>

<%

     // Select the entry from the table using the ID request parameter,
     // then fetch the row.
     photos.selectRowById(request.getParameter("id"));
     if (!photos.fetch( )){
          response.setStatus(response.SC_NOT_FOUND);
          return;

     }

     // Set the page context for the retrieve request, then retrieve
     // the image from the database and deliver it to the browser. The
     // getImage( ) method returns an object of type oracle.ord.im.OrdImage.

if (true){

          handler.setPageContext(pageContext);
          handler.sendImage(photos.getImage( ));
          return;
     }
%>
E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy