W3C home > Mailing lists > Public > www-jigsaw@w3.org > July to August 1996

SendMail PostableResource

From: Anselm Baird-Smith <abaird@w3.org>
Date: Fri, 26 Jul 1996 13:26:23 +0500
Message-Id: <9607261726.AA24615@www18.w3.org>
To: Pasquale Di Feo <pasdif@netfly.it>
Cc: www-jigsaw@w3.org
Pasquale Di Feo writes:
 > I have developed a simple PostableResource that send an e-mail
 > from a form.
 > 
 > I want return a file (specified in ATTR_REPLYFILE) for the response.
 > 
 > What is the best way ???


The simple answer is:

FileInputStream file = new FileInputStream(getValue(ATTR_REPLYFILE,null));
reply.setContentLength(file.available());
reply.setStream(file);
reply.setContentType(MIMEType.TEXT_HTML);
return reply;

Now thr right answer would be to create some FileResource, and to use
internal requests, unfortunatelly you will have to wait a couple more
weeks to get the details...

BTW the problem with the simple way is that as HTTP is getting more
and more complex, even simple things - such as serving a file - might
need more work then you thought...(weel simple way will work, but it
won't take advantage of HTTP/1.1 features)

Anselm.
Received on Friday, 26 July 1996 13:26:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:25 GMT