tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiten Hemchand Vira" <>
Subject Posting data to a JSP kept residing in Tomcat
Date Fri, 17 Aug 2001 10:40:15 GMT
    I am posting some data using HTTP to a JSP kept in the
"examples/jsp" directory of Tomcat. The code of the JSP is as follows

"<%@ page language="java" import="*" %>

int len;
final int blockSize=1024;
byte buf[]=new byte[blockSize];

ServletInputStream sis=request.getInputStream();
FileOutputStream fos=new FileOutputStream("C:\\test.txt");

while ((, 0, blockSize))!=-1) 
fos.write(buf, 0, len);



But when some data is posted to the above JSP page instead of data being
written to the file C:\test.txt only the file C:\test.txt gets created
with zero bytes as the size.

There is no problem with the JSP because the JSP runs fine when tested
under Java Web Server 2.0. The file C:\test.txt is created with proper

One more thing to note is that the data which is posted is captured in
the log file jasper.log.

Any pointers regarding what could be the problem?? Please reply to my id


View raw message