Re: Reading an image from a Servlet

Discussion in 'Java' started by tim cutler, Jul 3, 2003.

  1. tim cutler

    tim cutler Guest

    I'm quite new to java and have just run into this problem. I concur
    strongly with your desire for "a better approach...". I would like to
    see what your HTTP GET solution is, if you could post it?

    Manish Hatwalne wrote:
    > I tried reading it (servlet response) as bytes and then constructing an
    > ImageIcon from it. It did work, but there has to be a better way. Besides
    > for this approach how do I find out how many bytes are there? So that I can
    > allocate array accordingly.
    >
    > There must be a better approach...
    >
    > - Manish
    >
    >
    > "Manish Hatwalne" <> wrote in message
    > news:bavf1e$4673m$...
    >
    >>I have a client program (in java), which POSTs (using HTTP POST) data to

    >
    > the
    >
    >>servlet, the servlet analyses this data and creates an image which is sent
    >>back as a PNG file by setting the content type appropriately.
    >>
    >>This client needs to post a lot of data to the servlet, so HTTP GET is out
    >>of picture, we have to use POST. The image generated by the servlet needs

    >
    > to
    >
    >>be displayed in the client GUI. Earlier, the test data was smaller and I
    >>used to send it with HTTP GET and pass this URL to ImageIcon which would
    >>give me the required image. It worked perfectly.
    >>
    >>Now my problem is how do I get the client to read the Image from the
    >>servlet? Any help, pointers will be greatly appreciated.
    >>
    >>- Manish
    >>
    >>
    >>
    >>

    >
    >
    >
     
    tim cutler, Jul 3, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andy Fish
    Replies:
    4
    Views:
    2,431
    Andy Fish
    Dec 17, 2003
  2. Sean Clarke
    Replies:
    1
    Views:
    1,917
    Sudsy
    Jan 7, 2004
  3. circuit_breaker
    Replies:
    2
    Views:
    2,045
    Jack Jia
    Apr 4, 2004
  4. chamikara
    Replies:
    1
    Views:
    49,907
  5. DiscoStu
    Replies:
    0
    Views:
    514
    DiscoStu
    Jul 8, 2004
Loading...

Share This Page