Hi All,
I am attempting to use Oracle 9i's interMedia classes to manage images
and thumbnails, and when attempting to display them in JSPs, I notice
that if I run this outside of Struts, all is well, but within Struts,
the image is no longer displayed.
Can anything be done to work around this possible context contention
issue?
Here is some of the JSP code:
<%@ page language="java" %>
<%@ page import="PhotoAlbumBean" %>
<%@ page import="oracle.ord.im.OrdHttpJspResponseHandler" %>
<jsp:useBean id="album" scope="page" class="PhotoAlbumBean"/>
<jsp:useBean id="handler" scope="page"
class="oracle.ord.im.OrdHttpJspResponseHandler"/>
<%
String id = request.getParameter( "id" );
String media = request.getParameter( "media" );
if ( id != null || media != null ) {
// Use a try block to ensure the JDBC connection is released
try {
// Select data and fetch the row
album.selectRowById( id );
if ( !album.fetch() ) {
response.setStatus( response.SC_NOT_FOUND );
return;
}
// Deliver the full-size or thumb-nail image
handler.setPageContext( pageContext );
if ( media.equals( "image" ) ) {
handler.sendImage( album.getImage() );
return;
}
if ( media.equals( "thumb" ) ) {
handler.sendImage( album.getThumb() );
return;
}
}
finally {
album.release();
}
}
%>