Yes, you are correct. Since you are communicating from servlet to custom
java application, you can send the data in any manner that the client
understands. You are, in effect, defining your own protocol and not
using pure HTTP.
Karl Moss's servlet book (http://www.servletguru.com/) discusses sending
data over the network connection. If you want to see how he did it,
check out TestDataStream.java, TestObjectStream.java,
DataStreamEcho.java, and ObjectStreamEcho.java from the code samples for
the book.
K Mukhar
Robert Zhang wrote:
>
> I have a servlet that will go to
> the database and return a text-binary-mixed message back to the client. The
> client is a Java application using HttpURLConnection and streams to
> communication with the servlet. I want to let the servlet send the message
> altogether to the client. So I won't use multipart servlet implementation
> like what's in Jason Hunter's book. Some people say the message has to be
> base64 encoded to convert it into ascii text and then be decoded at the
> receiving end. I understand this will definitely work. But can the servlet
> simply send the data as a binary stream without encoding it? The client
> application then will parse it into proper pieces. Since the client is an
> application, not a browser, and all the client cares about is to receive
> the original message with no loss of data, I don't see why the message HAS
> to be base64 encoded. Am I right?
___________________________________________________________________________
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