[jcifs] Problems with getOutputStream for a jCIFS client

Jan Christian Herlitz Jan.Christian.Herlitz at excosoft.se
Thu Apr 29 08:04:04 GMT 2004

Mike wrote: 

> Can someone write a Servlet for me that accepts a PUT request
> and prints "Hello, world"?

Here's a minimal servlet, accepting PUT requests.

 import java.io.*;
 import javax.servlet.*;
 import javax.servlet.http.*;

 public class MyServlet extends HttpServlet {
    public void doPut(HttpServletRequest req,
          HttpServletResponse res)
          throws ServletException, IOException {
       byte[] bytes = new byte[4096];
       int length = req.getInputStream().read(bytes);
       String str = new String(bytes, 0, length);
       System.out.println("Request: " + str);

/Jan Christian

More information about the jcifs mailing list