Hello all,

        Thanks a lot for the valuable sharing. As request, I attached a port
of
the URL code and listed as follow:

---------------------------------------------------------------------start
        try{
        String urlStr = new

String("http://www.somewhere.com/servlet/MyClient?para1=Something&para2=Some
thingElse");
        URL url=new URL(urlStr);
        URLConnection conn=url.openConnection();
        response.setContentType(conn.getContentType());
        PrintWriter out=new PrintWriter(response.getOutputStream(),true);
        int l;
        char cbuf[]=new char[8192];
        BufferedReader in=new BufferedReader(new
InputStreamReader(url.openStream()));
        while ( (l=in.read(cbuf,0,8192))!=-1 ){
                out.write(cbuf,0,l);
        }
        out.close();
    } catch (IOException e){
        System.out.println("Error:"+e.toString());
    }
---------------------------------------------------------------------end

        As I mentioned in the last email that the URL can work if I manually
keyin into IE but will be failed via my java program, so I concluded some
possible reasons and stated as follow

        1.      My Java servlet code is incorrect or
        2.      The Java runtime is outdated or
        3.      Java environment hasn't been set up correctly or
        4.      IE environment with Java hasn't been set up correctly.

        FYI, I've got the following error message returned after I clicked
on the return page which is a blank Web page with a little ActiveX icon on
the top left hand corner.

---------------------------------------------------------------------start
        Error Locating Object Handler
        There is no viewer available for the type of object you are trying
to open. The following information is available about this object:

        Address of object:
http://www.somewhere.com/servlet/MyClient?para1=Something&para2=SomethingEls
e
        Content Type:                   application/afp
        Possible location of viewer:    Microsoft ActiveX Gallery

        Do you want to go to this location to download a viewer for this
type of object? Yes/No
---------------------------------------------------------------------end

        I believe that the installation of AFP viewer plugin do not have
problem as IE can display my desired page after I manually keyin the URL.
FYI, my "www.somewhere.com" is an UNIX system.

        So would be very appreciated if you could share with me your
opinions. Thanks.

Regards,
Elan

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to