Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pagecontext release problem

 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am experience the following error:

around the following code:

any hints??
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that the exception is a result of the line with the release call in it? If you are relying on JSP line numbers reported in a stack trace, that's notorious for being almost right, but not quite.
Perhaps you could show us a few lines of code before and after where you think the problem is. Also the full stack trace never hurts.
And, are you calling getOutputStream() anywhere in your JSP code tree?
hth,
bear
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't use getOutputStream and then do something that causes getPrintWriter to be called. This is what happens when you try to forward to /minnaqua/minnaquaFramesetMain.jsp
Binary output from JSPs is a little tricky. You need to be sure your'e going to use the OutputStream before you call it. You can't call it and then decide to send character data via the PrintWriter. This is not allowed.
You also need to be careful not to accidentally output character data before the OutputStream is called, since this will call the PrintWriter and you will not be allowed to call the OutputStream.
It fits better in a Servlet.
Dave
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to mention that you'll get the same error if you have white space at the end of your JSP or if your JSP throws an Exception and attempts to forward to your error page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic