How can I model a JSP page in UML? What stereotype should I use for JSP within a class diagram?
How do I stop a JSP based download adding a newline to the first character of a file? I am using JSP to set a Content-Disposition in order to keep IE from automatically opening Excel/Word/Acrobat/etc when it sees a file type it recognizes. However, when I use ServletOutputStream to do this, for some reason I end up with a newline (ASCII hex 0A) character at the beginning of my file (I discovered this with a hex editor). This causes Word and Excel to blow up when I try to open the files because they can’t cope with the extra character. (I am using the ATG Dynamo Application Server and am hoping this is not an artifact of the implementation.) This is what my JSP looks like: <% // fname is the file name File f = new File(fname); InputStream in = new FileInputStream(f); ServletOutputStream outs = response.getOutputStream(); int bufferSize = 4096; byte[] ioBuffer = new byte[bufferSize]; byte[] lastBuffer; // last buffer long counter = 0; // how many bytes we have gotten through long fileSiz