webapplication does not display tiff images

B

bauer

Hi,
I wrote a small web-application that displays tif images that are
retrieved from a database. I use Tomcat "4.1.24-LE-jdk14" as
web-container on a windows XP system and AlternaTiff as Tif Viewer
plugin for IE. The application works fine. But now I want to move to a
unix box where I use Tomcat "4.1.31". If I execute the same request on
the unix system the image is not displayed anymore but I see a
question dialog box asking me if I want to save or open the file. If I
choose open the binary file is opened in a text editor. I really don't
know why. If I choose save and save the file as NNN.tif I can view it
with as tif viewer-> means the raw data is ok. The only difference I
saw (when I used axis Tcp Tunnel Monitor for monitoring the request
datastream) is the response Header from Tomcat

unix:
"HTTP/1.1 200 OK
Content-Type: image/tiff;charset=ISO-8859-1
Transfer-Encoding: chunked
Date: Tue, 26 Oct 2004 07:44:58 GMT
Server: Apache-Coyote/1.1"

windows:
"HTTP/1.1 200 OK
Content-Type: image/tiff
Transfer-Encoding: chunked
Date: Tue, 26 Oct 2004 07:55:18 GMT
Server: Apache Coyote/1.0"

Here is the code I used to generate the Tif page

<%@ page import="java.io.*"%><%@ page import="de.tui.tas.jsp.*,
java.util.*"%><%
//contains current Tif document information
DocumentBean docBean = (DocumentBean)
session.getAttribute("DOCUMENT_BEAN");

if ( (docBean != null) && (docBean.getCurrentDocument() != null)
&& (docBean.getCurrentDocument().getDocumentPage(0) != null))
{

DocumentPage DocPage = docBean.getCurrentPage();
String sFileName = DocPage.getPhysicalFileName();
String contentType = DocPage.getContentType();

//content type is currently always "image/tiff"
response.setContentType(contentType);
ServletOutputStream outter = response.getOutputStream();

try {
File file = new File(sFileName);
byte[] byteContents = new byte[(int)file.length()];
FileInputStream in = new FileInputStream(sFileName);
int retcd = in.read(byteContents);
in.close();
outter.write(byteContents);
outter.flush();
}
catch (Exception e)
{
e.printStackTrace();
}
}
%>

can anyone help me? thanks.

regeards,
Stephan.
 
A

Ann

bauer said:
Hi,
I wrote a small web-application that displays tif images that are
retrieved from a database. I use Tomcat "4.1.24-LE-jdk14" as
web-container on a windows XP system and AlternaTiff as Tif Viewer
plugin for IE. The application works fine. But now I want to move to a
unix box where I use Tomcat "4.1.31". If I execute the same request on
the unix system the image is not displayed anymore but I see a
question dialog box asking me if I want to save or open the file. If I
choose open the binary file is opened in a text editor. I really don't
know why. If I choose save and save the file as NNN.tif I can view it
with as tif viewer-> means the raw data is ok. The only difference I
saw (when I used axis Tcp Tunnel Monitor for monitoring the request
datastream) is the response Header from Tomcat

Nice to see you repeating your question, maybe I should repeat mine.
Did you move AlternaTiff too?
 
B

bauer

Ann said:
Nice to see you repeating your question, maybe I should repeat mine.
Did you move AlternaTiff too?


AlternaTiff is a client browser pluginto display tiff images in the
browser. This means that each client has to install this (or some
similar) pulgin. On my test client it is installed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top