Telling the browser that a new page is coming?

Hi,
if I already wrote some stuff to the client with out.print(), how can I tell the browser that he should "forget" the previous stuff and that now a new html page is coming? (maybe I want to do this under a certain condition).
  public void doPost(HttpServletRequest request,HttpServletResponse response)
      throws ServletException, IOException {
     //  REPLY
     PrintWriter out = response.getWriter();
     String retHTML = "<html><head><title>Send</title></head>";
     retHTML = retHTML + "<body text=\"#ffffff\" bgcolor=\"#000000\">";
     retHTML = retHTML + "<body text=\"#ffffff\" bgcolor=\"#000000\">";
     retHTML = retHTML + "<table border=\"0\" width=\"100%\" align=\"center\" cellspacing=\"6\">";
     retHTML = retHTML + "<tbody><tr><td align=\"left\" valign=\"top\"><font align=\"center\" color=\"#ffffff\">";
     retHTML = retHTML + "<b>Nachricht:</b></font></td><td valign=\"top\">";
     retHTML = retHTML + "<FORM action=\"http://www.mycgiserver.com/servlet/usul.Chat\" method=\"post\">";
     retHTML = retHTML + "<INPUT name=message><INPUT type=submit value=\"Send\"></FORM></td></tr></tbody></table></body></html>";
     out.println(retHTML);
        // FORGET IT, I WANT TO START ALL OVER
  }

Hi,
if I already wrote some stuff to the client with
out.print(), how can I tell the browser that he should
"forget" the previous stuff and that now a new html
page is coming? (maybe I want to do this under a
certain condition).
public void doPost(HttpServletRequest
t request,HttpServletResponse response)
throws ServletException, IOException {
     //  REPLY
     PrintWriter out = response.getWriter();
String retHTML =
"<html><head><title>Send</title></head>";
retHTML = retHTML + "<body text=\"#ffffff\"
bgcolor=\"#000000\">";
retHTML = retHTML + "<body text=\"#ffffff\"
bgcolor=\"#000000\">";
retHTML = retHTML + "<table border=\"0\"
width=\"100%\" align=\"center\" cellspacing=\"6\">";
retHTML = retHTML + "<tbody><tr><td align=\"left\"
valign=\"top\"><font align=\"center\"
color=\"#ffffff\">";
retHTML = retHTML + "<b>Nachricht:</b></font></td><td
valign=\"top\">";
retHTML = retHTML + "<FORM
action=\"http://www.mycgiserver.com/servlet/usul.Chat\
method=\"post\">";
retHTML = retHTML + "<INPUT name=message><INPUT
type=submit
value=\"Send\"></FORM></td></tr></tbody></table></body
</html>";
     out.println(retHTML);
// FORGET IT, I WANT TO START ALL OVER
You cant, but fortunately, you havent written anything yet to the client, so you can just empty your retHTML string.
By the way, when you build strings dynamically, you should really use StringBuffer since this is less memory expensive.
Ah hang on, you do have a out.println. Then you cant empty it anymore. Only way to do it, is to parse a bit of javascript function that will start a new request e.g.
out.println("<script>location.href=/webapp/servlet/newRequest");

Similar Messages

  • Whenever i have a mozilla browser on and i try to open another mozilla window browser it work pull up a new window. When close the browser that was on, it will still show up on Task Manager. Whats going on with this?

    Whenever i have a mozilla browser on and i try to open another mozilla window browser it work pull up a new window. When close the browser that was on, it will still show up on Task Manager. Whats going on with this?

    There are other things that need attention:
    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    *Shockwave Flash 10.0 r32
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/

  • JavaScript required. The browser that you are using does not support JavaSc

    I keep on getting this message when I'm trying to log on to Hotmail
    JavaScript required. The browser that you are using does not support JavaScript, or you may have disabled JavaScript
    And my browser (IE 6) cannot go to any java links. They either don't load or they are blank pages. I tried installing java, enabling them on the internet options, and even installed a new browser it is still the same thing!!!
    I'm very pissed right now but I really really need some help. Sorry for the inconvenience.
    Thank you, Zaragon

    JavaScript is different from Java. Somehow, security has gotten turn on in IE. If you go to tools, internet options, security, then look at Internet (for hotmail anyway), hit the custom level button, you will see that scripting has been disabled.

  • When I click on the tab with a + on it, located next to the active tab a new page does not open. If I click on "New Tab" in the File menu a new tab does not ope

    When I click on the tab with a + on it, located next to the active tab a new page does not open. If I click on "New Tab" in the File menu a new tab does not open.

    Hi jcatx2013, we don't really have enough information on your system to make specific suggestions...
    Could you test in Firefox's Safe Mode? That's a standard diagnostic tool to bypass interference by extensions (and some custom settings). More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using
    Help > Restart with Add-ons Disabled
    In the dialog, click "Start in Safe Mode" (''not'' Reset)
    Any difference?

  • I had a box on the top of the browser that has written, you got mail. The problem is it keeps repeating you got mail. I don't want to hear it.

    I had a box on the top of the browser that has written, you got mail. The problem is it keeps repeating you got mail. I don't want to hear it.
    This is an unsolicited ad for "winning" an I phone. I am very tired of winning all this junk. I certainly do not want ads talking to me now.

    This appears above the page, in the toolbar area? That's probably caused by an add-on. Try disabling ALL nonessential or unrecognized extensions on the Add-ons page. Either:
    * Ctrl+Shift+a
    * "3-bar" menu button (or Tools menu) > Add-ons
    In the left column, click Extensions. Then, if in doubt, disable (or remove).
    Often a link will appear above at least one disabled extension to restart Firefox. You can complete your work on the tab and click one of the links as the last step.
    Does that get rid of the ad?
    Two other things:
    (1) You may want to check the Windows Control Panel, Add/Remove Programs, for any undisclosed bundle items. Click the "Installed on" column heading to group by date so they are easier to spot. Remove whatever looks suspicious or unnecessary.
    (2) You may want to supplement your regular security software with some of the scanning/cleaning programs listed in our support article: [[Troubleshoot Firefox issues caused by malware]].

  • How to set a cookie in the browser from an html page called via an Iview

    How to set a cookie in the browser from an html page called via an Iview
    Hello all,
    I have an issue which is causing problems. I have a snap survey (html form with submit and cookie setting) which is embedded in a url iview.
    Although the submit and the form work fine, the portal will not allow the cookie to be set it seems.
    Is there a way to allow cookies to be set from an embedded page in a url iview??
    You will make my day if you know!
    System: EP7 SP13
    Kind regards
    Alex

    Hi,
    Check this:
    http://www.oracle.com/technology/products/ias/portal/html/same_cookie_domain_with_pdkv2.html
    Cookie Basics
    Web browsers have built in rules for receiving and sending cookies. When a browser makes a request to a web server and the web server returns cookies with the response, the browser will only accept a cookie if the domain associated with the cookie matches that of the original request. Similarly, when a browser makes a subsequent request, it will only send those cookies whose domain matches that of the target web server.
    These rules are designed to ensure that information encoded in cookies is only "seen" by the web server(s) that the originator of the cookie intended. These rules also ensure that the cookie cannot be corrupted or imitated by another server. By default, the domain associated with a cookie exactly matches that of the server that created it. However, it is possible to modify the domain at the time the cookie is created. Relaxing the cookie domain increases the scope of the cookie's visibility making it available to a wider "audience" of web servers.
    For example, if a cookie is created by a.us.oracle.com, it's domain will usually be set to a.us.oracle.com. This means that the browser will only send the cookie to a.us.oracle.com. It will never send it to any other servers. However, if at the time of creation, the domain of the cookie is set to .us.oracle.com, the browser will send the cookie to any server whose domain falls within .us.oracle.com. such as portal.us.oracle.com, provider.us.oracle.com, app.us.oracle.com etc
    Regards,
    Praveen Gudapati

  • When I start Firefox the Firefox "what's new" page pops up -- even after I answered the question and viewed the video

    Whenever I start Firefox I get my homepage and the Mozilla "what's new" page in tabs. It is annoying.

    Hi jhmalik,
    You should look at [https://support.mozilla.com/kb/Firefox+has+just+updated+tab+shows+each+time+you+start+Firefox this article about that specific issue] and the article [http://kb.mozillazine.org/Preferences_not_saved Preferences not saved]. These should give you all the information you need!
    If that doesn't work:
    # Type about:config in the address bar
    # Click ''I'll be careful, I promise'' if prompted
    # In the Filter input field type ''startup''
    # Double click on startup.homepage_override_url
    # Delete the text string and click ''OK''
    # Close Firefox and reopen the window to verify that it has worked.
    Hopefully this helps!

  • In Safari, the top of of the screen is no longer white; it's a dark gray, and everything is in shades of gray. The line that shows a page is loading is now  white instead of blue. Any ideas why it's so dark and in black/white?

    All of a sudden, in Safari, the top of the page is no longer white; instead it's a dark gray, and the bar where you type in a web address is a slightly lighter shade of gray. The rest of the page is in color like always. Also, the line that shows a page is loading is white against the gray background, isntead of the usual blue. Any thoughts?

    Tap "Private" on Safari Screen to disable Private Browsing. When top of screen is white, Private Browsing is off.

  • Need a VB-Script that read a txt-file and only the lines that are new since last time

    Hi,
    I need help to write a VB script that read all new lines since the last time.
    For example:  The script reads the textfile at specific time, then 10 minutes later the script read the file again, and it should now only read the lines that are new since last time. Anyone that has such a script in your scriptingbox?
    cheers!
    DocHo
    Doc

    Based on the excellent idea by Pegasus, where is a VBScript solution. I use a separate file to save the last line count read from the file, then each time the file is read I update the line count. Only lines after the last count are output by the program:
    Option Explicit
    Dim strFile, objFSO, objFile, strCountFile, objCountFile, strLine, lngCount, lngLine
    Const ForReading = 1
    Const ForWriting = 2
    Const OpenAsASCII = 0
    Const CreateIfNotExist = True
    ' Specify input file to be read.
    strFile = "c:\Scripts\Example.log"
    ' Specify file with most recent line count.
    strCountFile = "c:\Scripts\Count.txt"
    ' Open the input file for reading.
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile(strFile, ForReading)
    ' Check if the line count file exists.
    If (objFSO.FileExists(strCountFile) = False) Then
        ' Initial count is 0, so all lines are read.
        lngCount = 0
    Else
        ' Open the line count file.
        Set objCountFile = objFSO.OpenTextFile(strCountFile, ForReading)
        ' Read the most recent line count.
        Do Until objCountFile.AtEndOfStream
            lngCount = CLng(objCountFile.ReadLine)
        Loop
    End If
    ' Read the input file.
    lngLine = 0
    Do Until objFile.AtEndOfStream
        ' Count lines.
        lngLine = lngLine + 1
        strLine = objFile.ReadLine
        If (lngLine >= lngCount) Then
            ' Output the line.
            Wscript.Echo strLine
        End If
    Loop
    ' Close all files.
    objFile.Close
    If (lngCount > 0) Then
        objCountFile.Close
    End If
    ' Ignore last line of the file if it is blank.
    If (strLine = "") Then
        lngLine = lngLine - 1
    End If
    ' Save the new line count.
    Set objCountFile = objFSO.OpenTextFile(strCountFile, _
        ForWriting, CreateIfNotExist, OpenAsASCII)
    objCountFile.WriteLine CStr(lngLine + 1)
    objCountFile.Close
    Richard Mueller - MVP Directory Services

  • Has anyone experienced this problem: I am editing in FCP 7.0.3 on a Mac 10.6.8 - I have a clip in the browser that is full frame and matched the other clips but when I drop it in the time line it becomes a fully zoomed in version of itself

    has anyone experienced this problem: I am editing in FCP 7.0.3 on a Mac 10.6.8 - I have a clip in the browser that is full frame and fine and it matches the other clips in my bins but when I drop it into the time line it becomes a fully zoomed in version of itself and I can only see a small portion of the image.  What's going on?  I've noticed this has happened in the past randomly with other clips and it's driving me cray cray!  Any help appreciated greatly and thanks in advance for taking the time

    In the FCP Browser, click on the source clip that is showing up sized incorrectly to select it. Once it is selected, type Command + 9 to see the item properties for the clip. Either report those properties here, or take a screen shot of the item properties and post the screen shot here.
    Next, click anywhere in your sequence timeline and then type Command + 0 {zero} to see your sequence settings. Either report those settings or take a screen shot of the sequence settings and post that screen shot here.
    MtD

  • Manipulate the browser elements in report page....

    Hi,
    How to manipulate the browser elements in report page? i.e hiding the field element, hiding entire row, disable or enable a particular cell(or text field) from a row, hiding value in a cell....so on.
    i used apex_items to create a report text fields.
    I tried to manipulate fields using javascript API's, i cant get to...
    how to do this?
    Thanks....

    ok,
    I would like to order:
    first row: label1 spacer texfield1 spacer label2 texfield2 label3 spacer label3...
    secod row: label4 spa.....similarly
    I use a af:panelformLayout with rows 2 and maxColumns 3, but no orders....

  • Cannot open favourites using the Firefox tag that usually opens up the menu and a new page.. Now I get the dropdown menu but cannot open a new page, losing the homepage every time I explore, can you say WHY? all other versions worked fine!

    I cannot open a new page from the Firefox favorites menu, it worked before in other versions and this new 5.1 version, but stopped working a few days ago, uninstalled, downloaded a fresh program.. same problem exists. I usually leave my 'Home Page' as a stable page and just open 'new' pages for i.e. Google, Internet Banking etc. the '+' sign on my home page or other loaded pages does not operate, hate having to now constantly sign in to my hotmail home page if and when I open new pages, can you help?

    Websites remembering you and automatically log you in is stored in a cookie.
    * Create an allow cookie exception (Tools > Options > Privacy > Cookies: Exceptions) to keep such a cookie, especially for secure websites and if cookies expire when Firefox is closed.
    Make sure that you do not run Firefox in Private Browsing mode.
    * https://support.mozilla.com/kb/Private+Browsing
    * In [[Private Browsing]] mode all cookies are session cookies that expire if that session is ended, so websites won't remember you.
    * Do not use [[Clear Recent History]] to clear the "Cookies" and the "Site Preferences"
    Clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.
    * http://kb.mozillazine.org/Cookies

  • Can the default text in new Pages documents be changed? if so how?

    Can I change the default font style in Pages? If so how? I want all documents I wish to create to open in a new font.

    Hi Sheila,
    Open a new blank document from Template Chooser. Set the font and anything else you want as your standard, then File > Save As Template.
    Then in Pages > Preferences > General > For new documents > Use Template > Choose
    Then when you open Pages from the Dock (or LaunchPad if your system has that) you will get a blank document based on that template. Same when you go to File > New (command n)
    Regards,
    Ian.

  • How do I switch which of my 2 WLAN controllers is set to be the controller that accepts new WAPs?

    Hello:
    I have 2 WLAN controllers, a 4400 series and 5500 series controller.  The 4400 series has 100 seat limit on it, with 74 Access Points currently connected.  The 5500 series has a 250 max, but we bought it with only 50 licenses, and it is max'd out at 50.
    The 5500 controller is the controller that has a DNS entry so that the Access Points will know to find that controller as they're being added.  BUT, because we've reached our limit of 50 licenses, I'd like to be able to set the 4400 series controller to be the controller that new Access Points try to connect to.  By going back to the 4400 as the controller that new Access Points connect to buys me time to plan for more licenses on next years budget for the 5500 controller.
    Does anyone know how I can do this?  Does this make any sense...seeing there are 2 WLAN controllers in my environment.        
    Thank You,
    Jon         

    Thanks, I'll try this in the morning.
    I thought of something this evening while at home...Seeing I have 2 WLAN controllers, only the 5500 is listed as an A record on my DNS server.  The 4400 is not listed.  The 4400 is the one I'm attempting to enable master Controller Mode on, so that the 4400 can discover and manage any unmanaged APs.  I enabled Master Controller Mode, but I never changed the DNS A record's IP address to reflect the 4400.  If I change the DNS entry to be the IP of the 4400, then enable Master Controller Mode, do you think the controller will then see the APs?  I ask because a few threads ago, I asked Stephen which name to use when assigning a name to the primary controller...use the name on the controller or the name in DNS.  Stephen replied: "no, the DNS entry is specific to the discovery process. You want the IS-WLC-2 in the 'primary' name field."
    So, I'm hoping that switching the A record to be the 4400's IP address AND enabling master Control Mode will allow the APs to be discovered and managed.  Does this sound plausible?
    Thanks
    Jon

  • I have a new company iPhone 5 I backed up my old phone on the iCloud before it was replaced. The company put software on the phone when I got it but I can't figure out how to get my content back without erasing all the stuff that is new that they put on i

    I have a new iPhone 5 with company software from where I work. I backed my old phone before I got this one on iCloud but I cannot figure out to get my stuff onto this phone without erasing the content that was just put on it.

    The only way to do so is to start over: Settings>General>Reset>Erase All Content & Settings. You won't be able to use the backup of your old phone unless you are setting up a new phone.

Maybe you are looking for

  • Correlated message processing and QOS in BPM

    Hi, I need one clarification w.r.t correlated message processing within integration process. Is there any relationship between the QOS and correlation w.r.t message processing inside the BPM ? In otherwords, will the QOS automatically changed to EOIO

  • Personal domain pointing to my site published with iWeb, on MobileMe

    Just published my site using iWeb08 onto MobileMe and bought my domain name with GoDaddy. Having troubles getting the domain name www.brendaschroeder.com to point to my site http://web.me.com/brendalynnschroeder/Site/Welcome.html This is the first ti

  • 1KEJ : Runtime Error (SAP note 725478)

    Hello All When I run 1KEJ in my test system it gives a run time error both in forground and background mode (it gets cancelled). I have done settlement for only 1 Order and WIP is also there for only 1 Order. Since I am running 1KEJ for first time I

  • Automatic Deployment Rule for SCEP Definitions growing too large.

    See the deployment package for SCEP definition is now 256MB and growing.  How can we make sure it stays small?  The ADR creating the package is leaving 26 Definition in there right now.

  • CX_SY_DYNAMIC_OSQL_SEMANTICS error with dynamic SELECT statement

    Hello Gurus, We have a dynamic SELECT statement in our BW Update Rules where the the Selection Fields are populated at run-time and so are the look-up target and also the WHERE clause. The code basically looks like below:           SELECT (lt_select_