S
sasuke
Hello all.
I have been doing a bit of J2EE for the past few days and some things
are not very clear to me.
» What exactly happens when I set the content type? Does it help the
server or the client in understanding what to do or how to treat the
data transferred to them?
» When setting the "Content-Type" for sending binary data over the
wire (eg. byte array), what difference does it make if I choose
"application/octet-stream" or "multipart/form-data"? Can they be used
interchangeably or is there some subtle difference between them that I
should be aware of?
» In a servlet when I do:
InputStream in = request.getInputStream();
System.out.println(in.available());
I get a zero printed. Is this because the number of bytes which can be
read from the input stream without blocking is zero? If so, what could
be the logical reason behind this kind of output? Is this because
there is no guarantee when I would get a data due to some problem with
the connection? Is this behavior a part of some specification?
(Servlet / HTTP 1.1)
Please be very strict with me in answering the questions since I want
to make sure I get the entire thing correct along with the correct
type of terminology.
Thanks for your time and effort.
Regards,
/sasuke.
I have been doing a bit of J2EE for the past few days and some things
are not very clear to me.
» What exactly happens when I set the content type? Does it help the
server or the client in understanding what to do or how to treat the
data transferred to them?
» When setting the "Content-Type" for sending binary data over the
wire (eg. byte array), what difference does it make if I choose
"application/octet-stream" or "multipart/form-data"? Can they be used
interchangeably or is there some subtle difference between them that I
should be aware of?
» In a servlet when I do:
InputStream in = request.getInputStream();
System.out.println(in.available());
I get a zero printed. Is this because the number of bytes which can be
read from the input stream without blocking is zero? If so, what could
be the logical reason behind this kind of output? Is this because
there is no guarantee when I would get a data due to some problem with
the connection? Is this behavior a part of some specification?
(Servlet / HTTP 1.1)
Please be very strict with me in answering the questions since I want
to make sure I get the entire thing correct along with the correct
type of terminology.
Thanks for your time and effort.
Regards,
/sasuke.