thank you . Appreciate it a lot for the knowledge.
Sreekanth
-----Original Message-----
From: Bo Xu [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 06, 2001 2:06 PM
To: [EMAIL PROTECTED]
Subject: Re: Interfaces in Servlets
"[Your Full Name]" wrote:
> Have you used the dirst approach. Could you give any example code for
that.
>
> Sreekanth
> [...]
yes, I have used :-) but I am not sure about the "Content-type"(I use
"application/x-www-form-urlencoded")
-Servlet side:
...
byte[] baout=new byte[5];
baout[0]=(BYTE)((0 & 0xff));
baout[1]=(BYTE)((1 & 0xff));
baout[2]=(BYTE)((2 & 0xff));
...
OutputStream os=res.getOutputStream();
os.write(baout, 0, 5);
res.flushBuffer(); //?
...
- Applet side:
...
URL url=new
URL("http://hahahaha:8080/myapp/servlet/writebytesServlet");
URLConnection uc = url.openConnection();
uc.setDoInput(true);
uc.setDoOutput(true);
uc.setUseCaches(false);
uc.setRequestProperty("Content-type",
"application/x-www-form-urlencoded");
byte[] bain=new byte[5];
InputStream is=uc.getInputStream();
is.read(bain, 0, 5);
...
Bo
Sept.06, 2001
___________________________________________________________________________
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
___________________________________________________________________________
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