A simple question: do i have to close the stream?

do i have to close such input/output stream:
HttpServletRequest.getInputStream()
HttpServletRequest.getReader()
HttpServletResponse.getOutputStream()
HttpServletResponse.getWriter()
and why?
thanks!

i found one reason y we won't close the streams beacause see the example and explanation;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Obtain an output stream by using the HttpServletResponse object and one of the methods shown in the following two examples:
PrintWriter out = res.getWriter();
ServletOutputStream out = res.getOutputStream();
You can use both PrintWriter and ServletOutputStream in the same servlet (or in another servlet that is included in a servlet). The output of both is written to the same buffer.
Write the contents of the response to the output stream using the print() method. You can use HTML tags in these statements. For example:
out.print("<html><head><title>My Servlet</title>");out.print("</head><body><h1>");out.print("Welcome");out.print("</h1></body></html>");Any time you print data that a user has previously supplied, BEA recommends that you remove any HTML special characters that a user might have entered. If you do not remove these characters, your Web site could be exploited by cross-site scripting. For more information, refer to Securing Client Input in Servlets.
Do not close the output stream by using the close() method, and avoid flushing the contents of the stream. If you do not close or flush the output stream, WebLogic Server can take advantage of persistent HTTP connections, as described in the next step.
Optimize the response.
By default, WebLogic Server attempts to use HTTP persistent connections whenever possible. A persistent connection attempts to reuse the same HTTP TCP/IP connection for a series of communications between client and server. Application performance improves because a new connection need not be opened for each request. Persistent connections are useful for HTML pages containing many in-line images, where each requested image would otherwise require a new TCP/IP connection.
Using the WebLogic Server Administration Console, you can configure the amount of time that WebLogic Server keeps an HTTP connection open.
WebLogic Server must know the length of the HTTP response in order to establish a persistent connection and automatically adds a Content-Length property to the HTTP response header. In order to determine the content length, WebLogic Server must buffer the response. However, if your servlet explicitly flushes the ServletOutputStream, WebLogic Server cannot determine the length of the response and therefore cannot use persistent connections. For this reason, you should avoid explicitly flushing the HTTP response in your servlets.
You may decide that, in some cases, it is better to flush the response early to display information in the client before the page has completed; for example, to display a banner advertisement while some time-consuming page content is calculated. Conversely, you may want to increase the size of the buffer used by the servlet engine to accommodate a larger response before flushing the response. You can manipulate the size of the response buffer by using the related methods of the javax.servlet.ServletResponse interface.
The default value of the WebLogic Server response buffer is 12K and the buffer size is internally calculated in terms of CHUNK_SIZE where CHUNK_SIZE = 4088 or 4Kb; if the user sets 5Kb the server rounds the request up to the nearest multiple of CHUNK_SIZE which is 2. and the buffer is set to 8176 or 8Kb.

Similar Messages

  • I keep getting a message that Firefox is open and not responding. That I have to close the Firefox application or restart my computer. A real pain. Why is the firefox application not closing in English

    I keep getting a message that Firefox is open and not responding. That I have to close the Firefox application or restart my computer. A real pain. Why is the firefox application not closing.

    Sounds like Firefox is "hanging at exit". That problem is frequently caused by an Extension or a Plugin. Read all of the following articles.<br /><br />
    NOTE: Establish a habit of exiting/closing Firefox with Firefox button > Exit or File > Exit to allow an orderly shutdown of Firefox and closing of all of the files that Firefox has open.
    #Stop the Firefox process:
    #*[http://kb.mozillazine.org/Kill_application Mozillazine - Kill application]
    #*Windows 7 users click [http://www.techrepublic.com/blog/window-on-windows/reap-the-benefits-of-windows-7s-task-manager/2576 here]
    #*Mac users: http://techheavy.com/2011/02/the-mac-task-manager/
    #Why Firefox may hang:
    #*[http://support.mozilla.org/en-US/kb/Firefox+hangs Firefox hangs] (see Hang at exit)
    #*[http://kb.mozillazine.org/Firefox_hangs Firefox hangs (Mozillazine)] (see Hang at exit and Closing Firefox properly)
    #*[https://support.mozilla.org/en-US/kb/Firefox+is+already+running+but+is+not+responding Firefox is already running but is not responding]
    #Use Firefox Safe Mode to find a problem with an Extension or Plugin:
    #*Don't check anything when entering Safe Mode, just continue
    #*If the problem does not occur in Safe Mode it is probably an Extension or Plugin causing the problem
    #*See:
    #**[[Safe Mode]] and [http://kb.mozillazine.org/Safe_Mode Safe Mode (Mozillazine)]
    #**[http://support.mozilla.org/en-US/kb/Troubleshooting+extensions+and+themes Troubleshooting extensions and themes]
    #**[http://support.mozilla.org/en-US/kb/Troubleshooting+plugins Troubleshooting plugins]
    #**[http://support.mozilla.org/en-US/kb/Basic+Troubleshooting Basic Troubleshooting]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check --> http://www.mozilla.org/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.org/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.org/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *'''''Shockwave Flash''''' (Adobe Flash or Flash): [https://support.mozilla.org/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *'''''Next Generation Java Plug-in for Mozilla browsers''''': [https://support.mozilla.org/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • When I switch between networks firefox is not working. I will have to close the browser and open it again!?

    Hi,
    I love firefox!!! I wanted it to be perfect all the time, one issue I come across with it recently is: When I switch between networks (say connecting to myoffice network through VPN when firefox is already open) firefox is not working. I will have to close the browser and open it again to make it work! could you please fix this.
    Thanks.
    Raja Pattamsetty

    If an option or preference settings not being saved after you restart firefox see:
    [http://kb.mozillazine.org/Preferences_not_saved Preferences not saved]
    thank you
    Please mark "Solved" the answer that really solve the problem, to help others with a similar problem.

  • When I click on "System services" it just stays highlighted and have to close the settings down

    I have been have problems with my Iphone5S battery life recently, I have followed the steps to save as much battery life as possible and I went to a genius bar as I thought the battery may be on its way out but they ran tests and told me its still a healthy battery, in the 90% mark and anything over 80% is good especially when I have had over 500 charges. They told me software errors and crashes have occured a lot and to complete a fresh install of IOS which I'm hoping i factory settings, which I have just completed yesterday and so the software is completely new. I have found that the battery has already decreased by 10% in 20 minutes without hardly any use, I wanted to go to system services and turn off certain services and it just freezes on this title when clicked on and I have to close the setttings app down double tapping the home button. Has anyone else noticed this issue and does anyone reccomend any advice, do I need a new battery etc?
    thankyou

    UPDATE
    I have solved the settings issue so the main issue is have I reset the phone correctly and should I replace my battery? thanks

  • I have mavericks installed. my safari crush since this morning. to use it again i have to close the program and reopen it. after few clicks crushes again. any idea?

    i have mavericks installed.
    my safari crush since this morning (I can not scroll between pages, if I try to reopen the page, safari open in exactelly same point is blocked).
    to use it again i have to close the program and reopen it. after few clicks crushes again. any idea?

    Quit the application. Force quit if necessary.
    Relaunch it by holding down the shift key and clicking its icon in the Dock. From the menu bar, select
    Safari ▹ Preferences... ▹ Privacy ▹ Remove All Website Data

  • I forgot my sercutity questions answers and have not received the email with instructions.

    I Have forgotten my sercutity question answers and have not received the email with instructions. 

    Unless it’s in a spam filter, you need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (121954)

  • Ctrl+S and file save just get ignored and I have to close the file to save docs

    I am using DW CS5.5.
    Ctrl+S and file>save just get ignored and I have to close the file to save docs.
    Any ideas? Thanks

    "If this configuration folder is the one in the Program Files hierarchy, you may have shot yourself in the foot.  Never mess with those."
    I had a neighbor one time who was annoyed that "that darn bolt on the bottom of my engine" kept scraping on the curb when he'd pull in or out of his driveway, so he ground it down till it was flat with the oil pan. It wasn't till about a year later when he took the car in to have the oil changed that he realized the error of his ways. Cost him $500 to have the pan pulled and replaced.
    If you don't know what it does, find out first or leave it alone.

  • This is a silly question but how do you close the angle editor in the timeline and go back to my master multicam clip for editing? I'm having a brain **** right now...

    This is a silly question but how do you close the angle editor in the timeline and go back to my master multicam clip for editing? I'm having a brain **** right now...

    Never mind...found the cure  Command-{  ...thanks to a  TWolfsky thread...

  • OS X Server Error: No existing connection from which credentials can be copied. It will not let me get out of the screen.  I have to close the Server App to get out. Any suggestions?

    Editing any user profile, when I try to save the change I get the error: no existing connection from which credentials can be copied. It will not let me get out of the screen.  I have to close the Server App to get out. Any suggestions?

    This is also being disucssed somewhere else https://discussions.apple.com/thread/5486117. I have the same problem, sorry i can't help.

  • When I open Firefox 5.0.1 (using Windows XP Home), Firefox starts to open tab after tab automatically and I have to close the program to stop the proceeding misfunction! ??

    When I open Firefox 5.0.1 (using Windows XP Home), Firefox starts to open tab after tab automatically and I have to close the program to stop the proceeding misfunction! ??

    See [[Firefox keeps opening many tabs or windows]]

  • Pages and numbers will not take dictation and iOS 8. Very frustrating screen goes blank no keypad. I have to close the document In order to get rid of the big blank space where the keyboard should ber

    Pages and Numbers will not take dictation in iOS 8 on my iPad 4 and iPad mini.
    Very frustrating -screen goes blank where keyboard should be when I touch the microphone- no keypad & dictation does not record. I have to close the document In order to get rid of the big blank space where the keyboard should be. When is this going to be fixed?it's making recordkeeping Pages and Numbers,  which I use heavily, almost impossible.
    also dictation in other locations such as Mail put capitals in the middle of sentences and sometimes don't capitalize first letter in a sentence (see first letter of this sentence!) and other instances like the months of the year or the days of the week. Is anyone else having these problems?

    Pages and Numbers will not take dictation in iOS 8 on my iPad 4 and iPad mini.
    Very frustrating -screen goes blank where keyboard should be when I touch the microphone- no keypad & dictation does not record. I have to close the document In order to get rid of the big blank space where the keyboard should be. When is this going to be fixed?it's making recordkeeping Pages and Numbers,  which I use heavily, almost impossible.
    also dictation in other locations such as Mail put capitals in the middle of sentences and sometimes don't capitalize first letter in a sentence (see first letter of this sentence!) and other instances like the months of the year or the days of the week. Is anyone else having these problems?

  • HT5312 Hello I have purchased the account from the shop for mobile phones and when Dgt a balance of $ 75 U.S. dollars tried to go down some programs, but ask me to answer questions and there have even when the shop is not accepted to give me any data abou

    Hello I have purchased the account from the shop for mobile phones and when Dgt a balance of $ 75 U.S. dollars tried to go down some programs, but ask me to answer questions and there have even when the shop is not accepted to give me any data about amyl which bearing correctly and password also trueThe name is true, how can I re-answer these questions??? replace phones is that Ahab Please give me the quick fix and sent the answer to Emile is:[email protected]

    Well I can't understand your english at all. If you need to reset your security questions, then try this:
     Account Security Team (AST) 
    Check the AppleCare number for your country here:
    http://support.apple.com/kb/HE131
    Call them up, and let them know you would like to be transferred to the Account Security Team.
    Or… click on the blue "Start your support request online" links.

  • If I restart an iPhone that is sharing a photostream with another account.. Will that account still have access to the stream?

    If I restart an iPhone that is sharing a photostream with another account.. Will that account still have access to the stream?

    Keep a backup from contacts (Address Book>File>Export>Address Book Archive) and Calendar (iCal>File>Export>iCal Archive) of your Mac and then press "replace".

  • Firefox keeps running in the backround after closing it, it just lingers there, and when I try to restart firefox, it says that I have to close the current one or restart my system to clear the last firefox. what can I do, thanks...

    After the last update, my IBM Clone computer does not close the session of firefox when clicking on "close" it clears the screen back to the desktop but firefox continues to hang there in the backround and will not allow another session of firefox to start until the first session is closed. The only way to reconnect is to do a restart on my system, and then the old firefox session is closed and the new session will start.

    Must be the "hang at exit" problem. <br /><br />
    #Stop the Firefox process:
    #*[http://kb.mozillazine.org/Kill_application Mozillazine - Kill application]
    #*Windows 7 users click [http://www.techrepublic.com/blog/window-on-windows/reap-the-benefits-of-windows-7s-task-manager/2576 here]
    #Why Firefox may hang:
    #*[http://support.mozilla.com/en-US/kb/Firefox+hangs Firefox hangs] (see Hang at exit)
    #*[http://kb.mozillazine.org/Firefox_hangs Firefox hangs (Mozillazine)] (see Hang at exit and Closing Firefox properly)
    #*[https://support.mozilla.com/en-US/kb/Firefox+is+already+running+but+is+not+responding Firefox is already running but is not responding]
    #Use Firefox Safe Mode to find a problem with an Extension or Plugin:
    #*Don't check anything when entering Safe Mode, just continue
    #*If the problem does not occur in Safe Mode it is probably and Extension or Plugin causing the problem
    #*See:
    #**[[Safe Mode]] and [http://kb.mozillazine.org/Safe_Mode Safe Mode (Mozillazine)]
    #**[http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes Troubleshooting extensions and themes]
    #**[http://support.mozilla.com/en-US/kb/Troubleshooting+plugins Troubleshooting plugins]
    #**[http://support.mozilla.com/en-US/kb/Basic+Troubleshooting Basic Troubleshooting]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • I am trying to reset my security questions, but I have not received the email with instructions. What is the problem?

    I initially created my apple account years ago. I am trying to reset my security questions because my answers are continually incorrect. I pressed the link that sends reset security questions info to my alt. address, but I have not received the email with instructions. I have resent the email several times and checked both of the emails I have set up with my apple account to no avail. I have tried everything that is provided in the support article about the issue and my problem has not be resolved. I've even deleted my alt email from the apple account and then reassigned it and tried again, however, I still have not received the email. Without knowing the answers to my security questions, I cannot purchase anything from the iTunes store, which I have been trying to do.
    I do not know what the problem is and I am asking for any resolutions. Please and thank you!

    Go to the Apple ID Security site from http://support.apple.com/kb/HT5699 or call the AppleCare support number from http://support.apple.com/kb/HE57 and ask to speak with the Account Security Team...either can help you reset your questions/answers.

Maybe you are looking for

  • Can not display the tables in developer

    Hi! I use the following applications: Database 1     NLSRTL      9.2.0.5.0     Production 2     Oracle9i Enterprise Edition      9.2.0.5.0     Production 4     TNS for 32-bit Windows:      9.2.0.5.0     Production PL/SQL Java™ Platform     1.5.0_06 O

  • In portal branding change the font colour of the popup dialog box

    hi all, I created  a theme of mine and changed the portal body colour to a dark shade. The porblem i am facing is..whn i click on the "Logout" button of the portal,it displays a popupbox saying "Are you sure you want to logg off?"...i want to change

  • Formatting the output in file out

    Hi, I have 5 fields in the internal table. I have used GUI_DOWNLOAD for downloading the file. The down loaded file looks like this. Field1      Field2  field3                      filed4              field5 ABC     1234     20080131/405FED     161.65

  • Not able to convert my application file from mxml to Action Script

    Hi,     In my mobile project I want to convert my application file from mxml to ActionScript.When I do this I get error and when I digged into the code I found that the error comes in preloader class initialize method as preloader property in System

  • Mini adaptor for altec im3 speakers

    can anyone advise where i can purchase the mini adaptor for the altec im3 speaker system??