You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Danno Ferrin <sh...@earthlink.net> on 2000/09/20 19:55:02 UTC

Re: why pop up the download dialog??

try setting content length as well, IE can be anal like that at times.

--Danno

Weffen Chueng wrote:
> 
> Hello ,
> 
> I have developed a jsp page, it read a image from disk, and then send it to browser.
> in fact i want to show the image directly in browser, so i set the content type as
> "image/jpeg". In netsacpe it is okay, but in IE, it always popup the dialog.
> here is some solutions for the problem, but i failed:
> 
> 1. <%@ page contentType="image/jpeg" %>  but still popup the dialog in ie;
> 2. response.setContentType("image/jpeg"); but still popup the dialog in ie;
> 3. response.setHeader("Content-type","image/jpeg"); but still popup the dialog;
> 
> How to sovle the boring problem??? i guess there is no any problem in my coding...
> Is it tomcat's bug?
> 
> --
> Best regards,
>  Weffen                          mailto:weffen@expertmedia.com.hk

Re: javac

Posted by Holger Klawitter <ho...@klawitter.de>.
> osvaldo [/home/osvaldo/javamail/javamail-1.1.3/work] > javac msg.java
> java.lang.NoClassDefFoundError: antlr/collections/AST
>         at at.dms.kjc.Main.beautifyParseError(Main.java:692)
>         at at.dms.kjc.Main.parseFile(Main.java:488)
>         at at.dms.kjc.Main.run(Main.java:119)
>         at at.dms.kjc.Main.compile(Main.java:449)
>         at at.dms.kjc.Main.main(Main.java:432)

This is quite obvoiusly a problem with your java compiler and has
nothing to do with either tomcat or javamail. It seems that one
of of jarfiles belonging to your compiler is missing in your classpath
you are unsing on your shell prompt.

Regards,
Mit freundlichem Gruß,
	Holger Klawitter
--
Holger Klawitter                                    +49 (0)251 484 0637
holger@klawitter.de                            http://www.klawitter.de/


javac

Posted by Osvaldo Brito <os...@laplace.inesc.pt>.
Hi,

I'm using the javamail api for the first time, and i'll appreciate very
much if you you could help me compiling my first java source. I'm working
on linux, and i wrote the following test program:


import javax.mail.internet.*;
                        //Mimemessage
import javax.mail.*;
                        //Session
import java.util.*;
import java.io.*;
                                           //FileInputStream
import java.lang.*;
                                        //System

/* ficheiro msg.java: le 1 mensagem mime de 1 ficheiro mime e escreve no
ecran a mensagem

*/
public class msg {

          FileInputStream mimeStream =
  try {
          mimeStream=new FileInputStream(
                new File(
"/home/osvaldo/javamail/javamail-1.1.3/correio.txt" ));}
          catch (Exception e) {
                System.err.println(e.getMessage());
                System.exit(0);}

  /* get a properties object */
//  Properties props = new 
System.getProperties();  throws=SecurityException

        Properties props =
  try {
        props = new System.getProperties();}
        catch(Exception e) {
                System.err.println(e.getMessage());
                System.exit(0);}

  /* get a session object */
  Session session =new Session.getDefaultInstance ( props, null );

 /* criacao do objecto do tipo mimemesage */
  mimemsg = new MimeMessage(session, mimefile); //throws
MessagingException

  /*escrita da mensagem no escran*/
  mimemsg.WriteTo (System.out);
}


when i run, javac msg.java i get this stdout,

osvaldo [/home/osvaldo/javamail/javamail-1.1.3/work] > javac msg.java
java.lang.NoClassDefFoundError: antlr/collections/AST
        at at.dms.kjc.Main.beautifyParseError(Main.java:692)
        at at.dms.kjc.Main.parseFile(Main.java:488)
        at at.dms.kjc.Main.run(Main.java:119)
        at at.dms.kjc.Main.compile(Main.java:449)
        at at.dms.kjc.Main.main(Main.java:432)


Any help? Thanks in advance for reading this mail.   



-- 
Osvaldo Brito

                                


Re: why pop up the download dialog??

Posted by Osvaldo Brito <os...@laplace.inesc.pt>.
Hi,

Can i use a api such javamail to use with jsp tecnology?

Thanks in advance.

Osvaldo Brito

-- 

                                


Re: why pop up the download dialog??

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Danno Ferrin wrote:

> try setting content length as well, IE can be anal like that at times.
>
> --Danno
>

Even with this issue fixed, you're going to have problems with the fact that JSP pages are
generally used for text output, not binary output (images).  In particular, a JspWriter is
a Writer (not an OutputStream), so it's going to be changing things on you based on what
it thinks the selected character set is.

Moral of the story -- if you want to generate binary output, use a servlet.

Craig


>
> Weffen Chueng wrote:
> >
> > Hello ,
> >
> > I have developed a jsp page, it read a image from disk, and then send it to browser.
> > in fact i want to show the image directly in browser, so i set the content type as
> > "image/jpeg". In netsacpe it is okay, but in IE, it always popup the dialog.
> > here is some solutions for the problem, but i failed:
> >
> > 1. <%@ page contentType="image/jpeg" %>  but still popup the dialog in ie;
> > 2. response.setContentType("image/jpeg"); but still popup the dialog in ie;
> > 3. response.setHeader("Content-type","image/jpeg"); but still popup the dialog;
> >
> > How to sovle the boring problem??? i guess there is no any problem in my coding...
> > Is it tomcat's bug?
> >
> > --
> > Best regards,
> >  Weffen                          mailto:weffen@expertmedia.com.hk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

--
====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat