Returning a html status code to the client browser

Hi,
Can anyone help me with a problem that I am have with regard to returning a html status code of NO_CONTENT to the client browser?
The Problem:
Basically I have a html form with a SAVE button. When the user clicks the SAVE button the data in the form is sent to the web server which then saves it in a database and the same populated form is then sent back to the client. From the users point of view they click the SAVE button and the screen is refreshed with the same data. The problem with this is that the data only needs to be SENT to be saved but not necessarily resent back to the client browser from the server i.e. from a user's point of view I don't want the screen to refresh by disappearing and then coming back again. There is a lot of data in the form so this refresh can take a considerable amount of time as the html can take a while to download.
The Potential Solution:
What I want to do is send the data to the server where it will be saved in the database and then return a html status code of NO_CONTENT to the browser (always Internet Explorer) so that the page doen't get refreshed / downloaded unnecessarily. I've implemented this and the save can now take as little as 10% of the time it used to take because the data is only sent and not received again.
The problem with the potential solution:
It works fine most of the time but not all of the time. We tested this change and it worked great but when we released it live it didn't work for some people. For most people you can see the status bar at the bottom of IE zip along as the data is sent to the server so you can see when it has finished or received the status code back. For the people it didn't work for they would get an almost full status bar at the bottom but the blue would never quite disappear to indicate that it was finished. It was as if it was sending the data from the server but not getting a response at all when it should have been getting the NO_CONTENT status code.
The Code:
I'm using Struts so the line of code I had originally used after the data had been saved to the database was:
     return (mapping.findForward("timesheet"));
I changed this line of code to:
     response.setStatus(response.SC_NO_CONTENT);
     response.flushBuffer();
     return null;
Can anyone see what the problem is here? Are the new lines of code not guaranteeing that the response is being sent back to the client? Is there a better way to simply return a status code when you don't want return a JSP page?
Any help would be greatly appreciated.
rgds,
Dave

I see what you mean now. It's a very good idea but it wouldn't really work for this application. I've taken out the ability to use "back" functionality on this screen. It is launched through javascript so that the window itself has no toolbar and also the page is set to expire so that if you do go "back" to it, you are forced to refresh the page so that it is guaranteed to have the same data as is on the server. This is needed to stop problems with other functionality of the application.
Thanks for the suggestion though.
Does anyone know why this code only works most but not all of the time?:
response.setStatus(response.SC_NO_CONTENT);
response.flushBuffer();

Similar Messages

  • How to get the HTML Source code from the active browser ?

    Hi All,
    I need to get the HTML Source code from the active browser (IE). I tried with the below code, but I am not able to get the Source code all the time, with respect to the different applications (http or https) and the user authentication has to be changes in few applications (_I dont know or not able to given that in the below code_). More over there is also a dependence of the URL to get the HTML Source code.
    Therefore what I feel is getting the HTML Source code from the given or active browser will be consistent than the URL. Since the Source code is available in the browser (IE) . Please help me with a sample code to achieve this . . . !
    HTMLDocument doc=(HTMLDocument) kit.createDefaultDocument();
    doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
    URL url = new URL(strURL);
    Reader HTMLReader = new InputStreamReader(url.openConnection().getInputStream());
    kit.read(HTMLReader, doc, 0);Thanks in advance,
    Regards,
    Jothi Venkatachalam
    Edited by: j0o on May 7, 2009 3:11 AM

    The simple answer is: you don't.
    Not only is it simply not possible, but the entire concept of "the active browser" doesn't exist.
    You were on the right track with your code to retrieve the page directly from the server, but as you noticed that code will only work for regular http connections.
    For https and other protocols you will need to use appropriate libraries for each protocol. Something like Apache Commons can help you with that. There are networking libraries in there for a lot of commonly used protocols.

  • AIM html status code not showing away with iChat

    Anyone else have issues with the html status code not showing away when you are away with iChat?
    Here is the code I am using: <a href="aim:goim?screenname=markformac" title="markformac"><img src="http://big.oscar.aol.com/markformac?onurl=http://www.exploitmymac.com/manual/aimon2.gif&offurl=http://www.exploitmymac.com/manual/aimoff2.gif" alt="iChat Status" /></a>

    HI Mark
    Tagless
    open tag a href="aim:goim?screenname=ralphjohnsr&message=Hi!,+I+came+from+your+website,ralphjohnsuk."close tag open tag img align="right" src="http://big.oscar.aol.com/ralphjohnsr?onurl=http://www.ralphjohnsuk.dsl.pipex.com//css/Resources/RalphOn.gif&offurl=http://www.ralphjohnsuk.dsl.pipex.com//css/Resources/RalphOff.gif" alt="Webmaster iChat Online Status Indicator" border="0" align="bottom" close tag open tag /a close tag
    I have mine sent to give me a message when people use it, where as you have yours titled.
    9:13 PM Friday; May 12, 2006

  • How can I see all the Transaction Code that the client is using?

    How can I see all the List of Transaction Code that the client is using?

    Hello Sugauli,
    Did you mean to ask
    transaction types the client is using?
    instead of
    transaction code
    If so, go to SPRO (in ERP system) and follow this path:
    Sales and Distribution -->
         Sales -->
             Sales Documents -->
                 Sales Document Header -->
                      Define Sales Document Types
    All the transaction types that are not used have an X in the column Block.
    Easwar Ram
    http://www.parxlns.com

  • Can I get information regarding the client browser using JSP

    can I get information regarding the client browser using JSP. like.. name, screen resolutions, font type, screen width and height of the browser etc.,
    if possible then please give me the samples..
    thanks,

    can I get information regarding the client browser using JSP. like.. name, screen resolutions, font type, screen width and height of the browser etc.,
    if possible then please give me the samples..
    thanks,

  • My ipod is disabled and say connect to iTunes when i connect to computer it say enter the pass cod but the ipod browser it's not showing ..any one can help me please, ty

    my ipod is disabled and say connect to iTunes when i connect to computer it say enter the pass cod but the ipod browser it's not showing ..any one can help me please, ty

    Place the iPod in Recovery mode and then restore

  • IP Address of the client/browser

    In my WDA application I need to find out the IP address of the client/browser.
    Is this available somewhere (attribute / method of the component controller?)??
    Thanks,
    Brad

    Hi Brad,
    Go to webdynpro application, of the created webdynpro component, there u find the URL ,the  host name.
    after that add that hostname in c:
    windowssystem32\drivers\etc\hosts file.
    for eg: 10.10.30.20   localhost
    The ip adrress, will be either local host (if server installed in same system) or the ip adrress of the installed server system.
    Cheers,
    Mary

  • How to display an html located in server to client browser?

    Hi,
    i want to display an html file located at the server to a client browser. how can i do it? and i want the user to select the particular file thru an open dialog box. will it be possible?
    regds,
    Abhi...

    in general about files :
    http://forum.java.sun.com/thread.jsp?forum=45&thread=522723&start=0&range=15#2502318
    simple for html: soemdecription

  • Detect JRE version of the Client Browser fiom a JSP

    I have an Applet that is called from a JSP page that works only in certain JRE versions .
    I was wondering if there is a way of finding the Installed JRE version of the Client ...

    You could use some of the old traditional Javascript code that determines what browser it's running in, and have that code pass different parameters to the applet based on its determination.

  • Recomnded setting for the client browser with oas

    Hi all,
    I am using webforms10g(9.0.4) with OAS(first release).
    In some sites the client can not open the reports(in rtf format)-the screen shows up
    for a second,and then disappear.
    In others the client get alert that allow him only to save the file(not to open).
    I think that it relate to security setting in the browser of the client(internet explorer).
    Is there recommend list for parameter setting in the explorer of the client for using with OAS?
    Thank in advance
    Z

    Hi Chris,
    Thanks for your answer.
    I will search about jinitator in metalink.
    Z

  • Open the web application in the client browser

    Please. I am newer to Oracle. I have MS 2000 Server installed, then Oracle 8i 8.17 standard edition release 3 installed and 9ias installed.
    The computer is using 192.168.1.2 as IP address.
    Follow the guide, I have created a database. I used Netscape 6.1 and go inside of http://mydomain.com/pls/portal30 to logon as single sign on to create some forms based on the tables created, where mydomain.com is something unqualified domain and never register at internic.
    However, except the computer I am using can see this web-page in a browser, all other users in the same local area network will result as "Page not found". But, strangely, if I type http://192.168.1.2 only at the other workstation's browser, I can the first page which is showing "Apacle..."
    Can anyone help me to solve how to make other workstations can see the page across the local area network. Some information is:-
    1. DNS server has installed in this computer but no server has been added.
    2. The primary and secondary DNS server is provided by local ISP
    3. I only have a single IP address of 192.168.1.2 and one default gateway ip address of 100.100.1.50
    Much thanks

    How does the client know the address of the web server.
    You said it's not in DNS, then you must put it in the hosts file on the client.
    When you go to the ip address the apache page shows. OK then when you enter /pls the portal will redirect to the FQDN which the host cannot resolve. Hence the page will not appear.
    Is this an intranet??? or do you need internet access to your portal??? ( if you do need internet access then is Win 2K secure)
    If it is an intranet then you must look at your internal host name resolution. If it is an intranet then why use a FQDN??? our portal intranet uses a hostname only and WINS (NT4) to supply clients with the address. using the Hosts file is even quicker.
    Once you have sortd out the hostname resolution problem then Netscape /ie on the client must be configured to bypass your proxy so that they can access the intranet portal server direct (otherwise they will look up the address on your ISP's DNS).
    Hope this helps.

  • Not able to get the error code when the client ,server running in Diff JVM

    Hi ,
    My server code is running on websphere App server . My client is running on different JVM on my machine .
    When I try to throw my own exception , I am not getting any data in the exception object.
    I am setting error code and msg in the exception object.
    But when i retrive from my client , it is returning the null.
    Can some one throw some info regrading this .

    Hi,
    Did this issue occur on all clients?
    Please run ipconfig /all command on this problematic computer, and then post the screenshot here.
    In addition, update your network adapter, disable the firewall and anti-virus temporarily and then run these commands:
    netsh winsock reset catalog
    netsh int ip reset
    Meanwhile, please refer to this article to troubleshoot:
    DHCP Clients Are Unable to Get IP Addresses from a DHCP Server
    http://support.microsoft.com/kb/197197/EN-US
    Karen Hu
    TechNet Community Support

  • Show a blob( pdf ) from db-table  in the clients browser/ web.show_document

    my env:
    Database R11_2 on one windows-host-machine
    AS 10 g on another windows-host-machine
    I can show files in Forms10g from inside the AS with web.show_document,
    that works fine
    but now I want to show a ( pdf or text ) File from a BLOB in a Table inside in the Database
    to the Browser running in Forms on AS,
    I do not want to create a extra Form for this reason, but want to show it in browser - windows
    ( how ) can I use web.show_document against a URL on the Database R11 ?
    what other tool , java ?
    regards

    Easiest way is probably to use mod_plsql and wpg_docload.download_file. If you retrieve the blob content from some table, than you can show it with a generic procedure like:
    procedure show_webdoc(io_blob          in out nocopy blob
                         ,i_mimetype       in varchar2
                         ,i_filename       in varchar2)
    is
    begin
       if dbms_lob.getlength(io_blob) >0 then
          owa_util.mime_header(nvl(i_mimetype,'application/octet'),false);
          htp.p('Content-length: ' || dbms_lob.getlength(io_blob));
          htp.p('Content-Disposition:  attachment; filename="'||i_filename|| '"');
          owa_util.http_header_close;
          wpg_docload.download_file(io_blob);
       end if;
    end show_webdoc;

  • OSB: Retrieve non XML Payload from a service that returns status code 500

    Hello,
    I'm using OSB 11g.
    I have a Business Service that invokes a REST based service (AnyXML). The service I'm calling may return a 500 status code and some JSON-encoded information in the response body containing the remote service error information.
    From a Proxy Service, I invoke the Biz Service using a standard Service Call Out. The Call Out works fine if the service doesn't return any error (status code 200).
    The problem starts when the service returns a 500 status error: it seems that there is no way to to get hold of the error information (string) that are in the response body. The $fault variable contains some info, but not the actual payload.
    I have also tried to "resume" the flow (using a resume action) but no luck.
    Is there a way to retrieve a NON-XML payload of a service even if the service returns a 500 status code?
    Thanks
    Luciano

    Hi,
    I have same problem, any idea?
    I created several Proxy Services between SOA (BPEL) and JDE. Proxy Service works correct, but if interface response has an error (fault) from JDE side, we get high level error message from OSB and we lost error information from endpoints. I want to get following error information from response body, which containing the remote service error information.
    e.g. <SOAP-ENV:Fault>:
    <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
    <faultcode>SOAP-ENV:Client</faultcode>
    <faultstring>[ISS.0088.9134] Exception occurred while processing the body of the message</faultstring>
    <faultactor>http://HOST/soap/default</faultactor>
    <detail xmlns:webM="http://www.webMethods.com/2001/10/soap/encoding">
    <webM:exception> </webM:exception>
    </detail>
    </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Until now, I solved errorhandling for Proxy Service with single route node, but if I use Proxy Service for “Failover” and OSB connect to Endpoint 2, BPEL-instances with "fault" state get OSB error message and WSG-Response will be lost from $body of messages.--> error-propagation to client is NOT OK.
    Regards,
    Moh

  • Returning HTTP status codes (401, 403, etc) to Flash 8

    Hi all,
    I'm using AMFPHP on the server-side and Flash remoting
    classes to communicate with it. Everything's working great, but i'd
    like Flash to be able to recieve HTTP status codes from the server.
    For example, if on the server side (in PHP) I go:
    header("Status: 401 Unauthorized");
    I'd like the remoting service on the flash side to be able to
    get the HTTP error code (401 in the example above).
    I know this is possible with
    [url=http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context =LiveDocs_Parts&file=00002333.html]LoadVars.onHTTPStatus[/url]
    but it doesn't seem to deal with using it with Flash Remoting.
    Thanks all :)
    - Nilesh

    Hi, I am trying to PUT to update contact info and I get following error:
    2015-01-16 11:00:17,970 INFO [main] oracle.eloqua.connector.eloqua.EloquaConnector.putWithBasicAuth(97) | accessHttpsPut.url=https://secure.eloqua.com/API/REST/2.0//data/contact/7606838, text={"id":"7606838","accountName":"openIdStr001","emailAddress":"[email protected]","type":"Contact"}
    2015-01-16 11:00:18,931 ERROR [main] oracle.eloqua.connector.eloqua.EloquaConnector.putWithBasicAuth(140) | ClientProtocolException
    org.apache.http.client.HttpResponseException: Request is malformed.
    Is there any idea?
    Thanks so much.
    Sincerely.

Maybe you are looking for