Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 83734 invoked from network); 8 Jul 2003 15:13:56 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 8 Jul 2003 15:13:56 -0000 Received: (qmail 17368 invoked by uid 97); 8 Jul 2003 15:16:24 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 17360 invoked from network); 8 Jul 2003 15:16:23 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 8 Jul 2003 15:16:23 -0000 Received: (qmail 82307 invoked by uid 500); 8 Jul 2003 15:13:37 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 82291 invoked from network); 8 Jul 2003 15:13:37 -0000 Received: from anchor-post-33.mail.demon.net (194.217.242.91) by daedalus.apache.org with SMTP; 8 Jul 2003 15:13:37 -0000 Received: from athoa-02.demon.co.uk ([80.177.1.132] helo=athoa.com) by anchor-post-33.mail.demon.net with esmtp (Exim 3.35 #1) id 19Zu9y-000C6a-0X for tomcat-user@jakarta.apache.org; Tue, 08 Jul 2003 16:13:38 +0100 Message-ID: <3F0ADFA2.2060800@athoa.com> Date: Tue, 08 Jul 2003 16:13:38 +0100 From: Mark Riddoch Reply-To: Mark.Riddoch@athoa.com Organization: Athoa User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Debugging "The document contains no data" error References: <20030708142918.51590.qmail@web42001.mail.yahoo.com> Content-Type: multipart/alternative; boundary="------------090304060800060107030801" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --------------090304060800060107030801 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Try closing the writer out.close(); R.U. Spell wrote: >I am having trouble with a servlet in Netscape v 4.76. >I am running Red Hat Linux 7.2. Thus far I have had >no luck in finding a solution in the archives or >elsewhere. > >The servlet (code included below) calls another class >that generates a JPG and outputs it to a file. A link >to the temporary image file is supposed to be >displayed on the page, but instead I get a pop-up >displaying "The document contains no data". > >I have verified that the servlet is generating the >image and placing it in my /tmp folder. I have also >tested it by outputting the image to >$CATALINA_HOME/temp. > >Any assistance that you can provide would be greatly >appreciated!! > >CODE... > >import java.io.*; >import java.text.*; >import java.util.*; >import javax.servlet.*; >import javax.servlet.http.*; > >import duke.cgt.bard.apps.SimpleBardApplication; > >public class BARD extends HttpServlet { > >static final String PATH = >"/home/www/pkg/jakarta-tomcat-4.0.6/temp/"; >static String datafile; > > >public void doBard(String file) { > String[] temp = new String[6]; > temp[0] = "-d"; > temp[1] = file; > temp[2] = "-type"; > temp[3] = "ie"; > temp[4] = "-o"; > temp[5] = PATH+"bard.jpg"; > > try { > SimpleBardApplication.main(temp); > }catch(Exception e) { > e.printStackTrace(); > } >} > > >public void doGet(HttpServletRequest request, >HttpServletResponse response) >throws IOException, ServletException >{ > datafile = request.getParameter("datafile"); > datafile = PATH + datafile; > > PrintWriter out = response.getWriter(); > > response.setContentType("text/html"); > response.setHeader("pragma", "no-cache"); > out.println(""); > out.println(""); > out.println(""); > out.println("BARD Demo"); > out.println(""); > out.println(""); > out.println("

BARD Demo

"); > out.println("This is the image file " +datafile); > out.println(""); > out.println(""); > > this.doBard(datafile); >} > >public void doPost(HttpServletRequest request, >HttpServletResponse response) >throws IOException, ServletException >{ > doGet(request, response); >} >} > >Thanks >Rus > > >__________________________________ >Do you Yahoo!? >The New Yahoo! Search - Faster. Easier. Bingo. >http://search.yahoo.com > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > > > > -- Mark Riddoch - Software Architect ATHOA Ltd. - Making CRM a reality Weir Bank Phone: +44 (0)1628 762 635 Bray-on-Thames Fax: +44 (0)1628 635 985 Maidenhead - SL6 2ED Mobile: +44 (0)7850 218 966 UK e-mail: Mark.Riddoch@athoa.com --------------090304060800060107030801 Content-Type: multipart/related; boundary="------------080207070201050909020909" --------------080207070201050909020909 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Try closing the writer

    out.close();

R.U. Spell wrote:
I am having trouble with a servlet in Netscape v 4.76.
I am running Red Hat Linux 7.2.  Thus far I have had
no luck in finding a solution in the archives or
elsewhere.

The servlet (code included below) calls another class
that generates a JPG and outputs it to a file.  A link
to the temporary image file is supposed to be
displayed on the page, but instead I get a pop-up
displaying "The document contains no data".

I have verified that the servlet is generating the
image and placing it in my /tmp folder.  I have also
tested it by outputting the image to
$CATALINA_HOME/temp.

Any assistance that you can provide would be greatly
appreciated!!

CODE...

import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

import duke.cgt.bard.apps.SimpleBardApplication;

public class BARD extends HttpServlet {

static final String PATH =
"/home/www/pkg/jakarta-tomcat-4.0.6/temp/";
static String datafile;


public void doBard(String file) {
     String[] temp = new String[6];
     temp[0] = "-d";
     temp[1] = file;
     temp[2] = "-type";
     temp[3] = "ie";
     temp[4] = "-o";
     temp[5] = PATH+"bard.jpg";

     try {
          SimpleBardApplication.main(temp);
     }catch(Exception e) {
          e.printStackTrace();
     }
}


public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
     datafile = request.getParameter("datafile");
     datafile = PATH + datafile;

     PrintWriter out = response.getWriter();

     response.setContentType("text/html");
     response.setHeader("pragma", "no-cache");
     out.println("<html>");
     out.println("<body>");
     out.println("<head>");
     out.println("<title>BARD Demo</title>");
     out.println("</head>");
     out.println("<body bgcolor=\"white\">");
     out.println("<H1>BARD Demo</H1>");
     out.println("This is the image file " +datafile);
     out.println("</body>");
     out.println("</html>");

     this.doBard(datafile);
}

public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
     doGet(request, response);
}
}

Thanks
Rus


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



  

--
Athoa Signature
Mark Riddoch - Software Architect
ATHOA Ltd. – Making CRM a reality
 

Weir Bank

Phone:

+44 (0)1628 762 635

Bray-on-Thames

Fax:

+44 (0)1628 635 985

Maidenhead - SL6 2ED

Mobile:

+44 (0)7850 218 966

UK

e-mail:

Mark.Riddoch@athoa.com




--------------080207070201050909020909 Content-Type: image/gif; name="ATHOA Logo - eMail.gif" Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: inline; filename="ATHOA Logo - eMail.gif" R0lGODlhjQAgAHcAMSH+GlNvZnR3YXJlOiBNaWNyb3NvZnQgT2ZmaWNlACH5BAEAAAAALAAA AACMAB4AhAAAAA8LPg8LPA8LOQ8LNw8LNg8LNA8LMgwLMRkSXRgSWxcSWBcQVhcPUxYPUBQP TBMPSRIORhIMRBELQRwVaxwVahwVaRsVaRoVaBoUZxoSZRoSYxoSYhkSYAECAwECAwX/ICCO ZGmeaApQbEupcCzPdG3fZaXvfIX/wKAw2POJisOkchm0OJ2nJ5RJrVpHl2w2pd1ev+AfZkxO kcvhtFqVabdh7vd6TtfY77A7ns4Pb/6AMICBfYVWHIiIMomJhnwdkJGRKJIdlJUylZYxmpsj nT+dkCeaKQmnqKmoJaoJKK0ysKatp6+yM7S3IqopCr6/Jb8KJMLDKMXGMMi9xTXNys8j0QDT IwvX2Asn2dbcKNnXMuDa2+Df3+Yp4+jhAOsmDPHyKfIMAPXx9Pj7/Psn/vDm/cOHAmDBfPfq nWjAsCEMhw0ZqohIsaJFhyUqoqC4kaMJjRMleizhoKTJGCZT/zpQoXIlSpUmWp6QORMmSZsw WpY08aCnzwcxfv5UIRRoUKEliqIoajSpUhJPYTA9AaGqVQgyrlaFoRVrjK4lwFLVmkLsCLNc yZqIwLbtjLZuVcBlK2NuhBJ2UeTVOxdv37pwUUgYTHgG4cExDheGoVhCicYpFEeWTAJyYsom JmjeLGMz5xieNcMIPSFz6BSnUZAusRp0ahMBYsuWIXt2jNqxYeAOABu3CtsodpcQrtt3CgHI k8NIzlwGc+TLm5t4LkCFchTUq5OgHoN7igHgw8MIT94EePPkB3xPjyK9+vbn4ZdHP389exLi ARDYv18F//78kRCgCf8RkEKBByJ4go2CBDIooIMNFmjggyMUYOGFKVxoIQAaitDhCRoWAOKH GYZoAoYYlhCiiCis2OKHMG44ggE01mhACTbeKEKONqrAIwk5yvDjjDTuWCOQQfo4pJE9Mrnk CAdEKeWUU5ZApZQwXKklDVpWCWWXUc4A5pVWkokCAmimqeaZa86gZps3vIkmm2/iICecJdQp QggAOw== --------------080207070201050909020909-- --------------090304060800060107030801--