Termination of request processing - Weblogic

This is a discussion on Termination of request processing - Weblogic ; Hi all, How to terminate a request which is in the midst of processing? Here's the situation: I have a jsp, having two buttons, "Submit" and "Stop". When "Submit" button is clicked, request is submitted for processing, and when "Stop" ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Termination of request processing

  1. Termination of request processing

    Hi all,

    How to terminate a request which is in the midst of processing?

    Here's the situation:
    I have a jsp, having two buttons, "Submit" and "Stop".
    When "Submit" button is clicked, request is submitted for processing, and when "Stop" button is clicked, the respective request which is submitted (still under processing) will be terminated.

    How can this be done? Is there any workaround?

    thanks in advance

  2. Re: Termination of request processing

    Tried using the browser stop button.

    Stop the browser sending request by using a javascript function.
    window.stop()

  3. Re: Termination of request processing

    During the server side process for handling the "submit" button click:
    Create a unique request number
    Store it in the session variable, (lets say) cur-req-id
    Process the request further
    Each step of the process, check if the stop-${req-id} variable is
    NOT NULL.
    If it is NOT NULL, stop the server side process OR contine to do the
    work .....
    ** Make sure finally section removes both cur-req-id and stop-${req-id}
    variables from the session.


    During the server side process for handling the "stop" button click:
    Get the current request id from session variable, "cur-req-id"
    Then, set a session variable, "stop-${req-id}" variable to "Y"

    Hope, you get the idea here ....

    Thanks,
    Selva-
    InfoTekies Corporation


    "Kok Shong YEW" wrote in message
    news:10789919.1102339133479.JavaMail.root@jserv5.. .
    > Hi all,
    >
    > How to terminate a request which is in the midst of processing?
    >
    > Here's the situation:
    > I have a jsp, having two buttons, "Submit" and "Stop".
    > When "Submit" button is clicked, request is submitted for processing, and
    > when "Stop" button is clicked, the respective request which is submitted
    > (still under processing) will be terminated.
    >
    > How can this be done? Is there any workaround?
    >
    > thanks in advance




  4. Re: Termination of request processing

    Use return statement in the JSP Scriplet to stop the request processing

    e.g

    <%
    if(conditon) {
    return;//this will stop the processing
    }
    %>

    Muthuselvan.C

  5. Re: Termination of request processing

    Hi,

    here you get parts of a possible solution

    When the user hits the stop button, or a javascript stops document from loading the socket communication is shut down immediately.

    I do remember that there earlier were some method somewhere to test this socket communication, this method I can not find anymore. However there are other options.

    This method will return true if there are some errors in communication to the client ( eg. socket closed )

    response.getWriter().checkError()

    The problem with thisone is that it toggles to true only then a failed attempt to communcate over the socket is attempted.

    My little testJSP shows this, see if this code may help you.

    for ( int i = 0; i < 20; i++ )
    {
    response.getWriter().print("a");

    System.out.println("**" + i);

    if ( response.getWriter().checkError() )
    {
    // if ever here, no point continuing
    System.out.println("terminate");
    }
    try
    {
    Thread.sleep(1000);
    } catch ( Exception e ) { e.printStackTrace(); }
    }

    - Anders M.

+ Reply to Thread