I am trying to print the output of a java file to a jsp file.
for(String x : list)
{
try {
output 1
}
catch {
output 2
}
}
The output 1
should go to x.jsp
file
The output 2
should go to y.jsp
file
Where do I give response.Redirect(x.jsp)
and response.Redirect(y.jsp)
?
If I give each statements within each block/try and catch) it will throw error:
cannot redirect after committing
Any help is much appreciated. Let me know if you don't understand my question correctly.