Hi Grant, I've been trying to use your class and after putting everything together 
including the servlet code you gave as an example I am still having problems.  Here is 
what I have:

public class FileServlet extends HttpServlet {

    public void doGet(HttpServletRequest request,
                    HttpServletResponse response) throws IOException {

            Win32Link lnk = new Win32Link();
         lnk.setWebfile("files on " + request.getServerName(),
                    "http://localhost:8080/storage/files/Survey.doc";,
                    "http://localhost:8080/storage/files/";);
        response.setContentType("application/octet-stream");
        byte [] data = lnk.getBytes();
        response.setContentLength(data.length);
        OutputStream out = response.getOutputStream();
        out.write(data);
  out.close();
}
}

When I access this servlet a save as box comes up and the filename is called 
"FileServlet", I then try to open it and it looks like byte code:

Example (it won't let me copy the text because of various characters): 
L||||||||||||||||F|||||||||||||||||||||||||||||||Y||||||||||||||||||||||||||||||�O� 
�:i 

Could you help me with this?

  ----- Original Message ----- 
  From: Grant Gongaware 
  To: Slide Users Mailing List 
  Sent: Wednesday, July 07, 2004 9:49 PM
  Subject: Re: Best Practice?


  Sorry, missed dependent ByteBuffer class.

  -Grant


  Grant Gongaware wrote: 
    Attached is the shortcut building class. Currently it can only make webfolder 
shortcuts, though someday I hope for more features like Local-drive/NetBIOS-share 
shortcuts and maybe other shortcuts like internal Outlook links or application 
launchers.

    Here's an example usage in a doGet() method of a Servlet -

            Win32Link lnk = new Win32Link();
             lnk.setWebfile("files on " + request.getServerName(),
                        "http://abc.org/pub/docs/report.xls";,
                        "http://abc.org/pub/";);
            response.setContentType("application/octet-stream");
            byte [] data = lnk.getBytes();
            response.setContentLength(data.length);
            OutputStream out = response.getOutputStream();
            out.write(data);
            out.close();

    -Grant

----------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


------------------------------------------------------------------------------


  ---------------------------------------------------------------------
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to