Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

getOutputStream and getWriter in servlet

Thread view: 
John Smith - 16 Jun 2006 08:37 GMT
In a servlet you can call either getOutputStream or getWriter but only one,
calling the other later gets an IllegalStateException. Is there a way of
finding out what has already been called?

Thanks

Jon
hiwa - 16 Jun 2006 10:18 GMT
John Smith :

> In a servlet you can call either getOutputStream or getWriter but only one,
> calling the other later gets an IllegalStateException. Is there a way of
[quoted text clipped - 3 lines]
>
> Jon

> calling the other later
Just don't do it.
Andrea Desole - 16 Jun 2006 10:29 GMT
> In a servlet you can call either getOutputStream or getWriter but only one,
> calling the other later gets an IllegalStateException. Is there a way of
> finding out what has already been called?

the best solution is to know what you call. There is no point in writing
binary data to a writer. I would say this is also the meaning of the
exception.

Besides that, I'm afraid the only possibility to know that a method has
been called is to catch the exception when you try to call the other one.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.