tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiten Hemchand Vira" <Hi...@infy.com>
Subject Posting data to a JSP kept residing in Tomcat
Date Fri, 17 Aug 2001 10:40:15 GMT
Hi,
    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="java.io.*" %>
<%

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

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

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

sis.close();
fos.close();

%>"

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
data.

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
also

TIA,
Hiten@infy.com

Mime
View raw message