• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

pagecontext release problem

 
Ranch Hand
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am experience the following error:

around the following code:

any hints??
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Evacuate the building! Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic