Hi,
I have a faced a scenario, wherein I am not able to know the reason for it.
While trying to display an html page (kept in my local directory), I have created 2 web projects. One with only a jsp and written file I/O code to get the file and writing in the ServletOutputStream. But it didn't work. It gave me IlleagalStateException, saying getOutputStream already called.
However, the other project wherein I had a servlet, with same code. It worked fine.
I am not understanding the reason.
Thanks
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 11863
posted
0
It gave me IlleagalStateException, saying getOutputStream already called.
Explains the reason - in a JSP, the output stream is automatically created by the code created by the JSP compiler so that you will have the automatic variable "out"
Examine the created servlet code to see all the work that JSP does automatically to set up out and other variables.