import com.caucho.server.http.*;
import com.caucho.vfs.*;
public void service(HttpServletRequest request,
HttpServlerResponse response)
throws IOException, ServletException
{
Request req = (Request) request;
Response res = (Response) response;
// change to raw mode. Resin will return a 101 response:
// HTTP/1.0 101 Switching Protocols
// Server: Resin/2.0
// Content-Type: text/html
// Content-Length: 0
// Date: Fri, 08 May 1998 09:51:31 GMT
//
// the raw data will appear immediately after the blank line
res.switchToRaw();
// you can use OutputStream instead of WriteStream. It's
// automatically buffered
WriteStream os = res.getRawOutput();
// you can use InputStream instead of ReadStream.
ReadStream is = req.getRawInput();
// following code will use is and os as raw streams.
}
|