hi
I have written a code for writing the data of a column from database into a file
and again reading that file and displaying.
Im writing into an .html file....Now the problem is im getting the output but that output is followed by an error.....
This is the output
-----------------------------
A large number of processes are available, and can be applied to an input or a group of inputs. These processes can be chained ogether so that the output from one process is used as an input to another process. In this manner multiple processes may be applied to an input .Error 500: Server caught unhandled exception from servlet [JSP 1.2 Processor]: getCompressingO utputStream() has already been called
Im not able to find wheres the mistake....Here is the code related to it
[CODE=Java]String strPath="\\\\en ggsw-061\public\\LLD atabase\\sugges tions\\textfile 1.html";
response.setCon tentType("APPLI CATION/OCTET-STREAM");
//writing into a file
File f=new File(strPath);
FileOutputStrea m fop=new FileOutputStrea m(f);
{
if(f.exists())
{
String struggestion=cL essonsLearntSea rchActionForm.g etSuggestions() ;
fop.write(strSu ggestion.getByt es());
fop.flush();
fop.close();
}
else{
some error message
}
}
//reading the file
FileInputStream fileIn = new FileInputStream (f);
OutputStream out = response.getOut putStream();
{
byte[] buffer = new byte[2048];
int bytesRead = fileIn.read(buf fer);
while (bytesRead >= 0) {
if (bytesRead > 0)
out.write(buffe r, 0, bytesRead); bytesRead = fileIn.read(buf fer);
}
out.flush();
out.close();
fileIn.close();
}
[/CODE]
Thanks
I have written a code for writing the data of a column from database into a file
and again reading that file and displaying.
Im writing into an .html file....Now the problem is im getting the output but that output is followed by an error.....
This is the output
-----------------------------
A large number of processes are available, and can be applied to an input or a group of inputs. These processes can be chained ogether so that the output from one process is used as an input to another process. In this manner multiple processes may be applied to an input .Error 500: Server caught unhandled exception from servlet [JSP 1.2 Processor]: getCompressingO utputStream() has already been called
Im not able to find wheres the mistake....Here is the code related to it
[CODE=Java]String strPath="\\\\en ggsw-061\public\\LLD atabase\\sugges tions\\textfile 1.html";
response.setCon tentType("APPLI CATION/OCTET-STREAM");
//writing into a file
File f=new File(strPath);
FileOutputStrea m fop=new FileOutputStrea m(f);
{
if(f.exists())
{
String struggestion=cL essonsLearntSea rchActionForm.g etSuggestions() ;
fop.write(strSu ggestion.getByt es());
fop.flush();
fop.close();
}
else{
some error message
}
}
//reading the file
FileInputStream fileIn = new FileInputStream (f);
OutputStream out = response.getOut putStream();
{
byte[] buffer = new byte[2048];
int bytesRead = fileIn.read(buf fer);
while (bytesRead >= 0) {
if (bytesRead > 0)
out.write(buffe r, 0, bytesRead); bytesRead = fileIn.read(buf fer);
}
out.flush();
out.close();
fileIn.close();
}
[/CODE]
Thanks
Comment