How to trigger so action when ServerletOuput stream writes all data as byte

Hi ,
I have a servlet which accepts the index , size of a .3gp file in bytes as input parameters.
If index=0 ...i am reading whole file into buffered input streame and writing to client as Servlet output steam as bytes.
If index !=0 , or index=100 ...say suppose
im ommiting first 100 bytes and rading101 byte to till the end of file in to buffered input streame and writing to client as Servlet output steam as bytes.
Here i would like to trigger some action when the servlet writes entire bytes to the client .
But im not able to notify exactly when the connection can close between client and server.
Can any one help me to overcome this.
Thanks in advance.

Hi ,
Thanks for reply..
But reallu i couldnt get you.
please go though the code snippet i have...and suggest me.
try{
File fFile = new File (fileName);
BufferedInputStream bif = new BufferedInputStream(new FileInputStream(fFile));
     bif.skip(Integer.parseInt(((DownloadFileForm)o).getIndex()));
int byteSize = (bif.available() < Integer.parseInt(((DownloadFileForm)o).getSize())) ? bif.available() : Integer.parseInt(((DownloadFileForm)o).getSize());
byte[] b = new byte[byteSize];
bif.read(b, 0, byteSize);
sosStream = response.getOutputStream();
sosStream.write(b);
// here i have to do something
sosStream.close();
logger.info("file has been downloaded from Server is sending out to client");
}catch(Exception e)
// e.printStackTrace();
logger.info("Exception :"+e.toString());
regards,

Similar Messages

  • How to trigger an Action

    Hello,
    I need help to find out how to trigger an Action (Action Definition) from an ABAP program. The program should trigger the Action used to create a follow-up transaction from an existing Contract.
    Thanks in advance,
    Jonas

    Hi! Every one
    I am using codes mentioned in this tread but getting one exception at the time when SAP is trying to save the changes for the change process action data. I am able to run the change process action programmatically ( successfully ) and when i enter some data for the change process action and press the execute button, I am getting one exception. I have attached the exception in this text. Can any one please give any clue why this exception is coming and what else I need to do?
    Thanks
    Yogesh
    Runtime Errors         UNCAUGHT_EXCEPTION
    Except.                CX_OS_OBJECT_NOT_FOUND
    Date and Time          13.03.2007 16:14:30
    Short dump has not been completely stored (too big)
         Short text
              An exception occurred that was not caught.
         What happened?
              The exception 'CX_OS_OBJECT_NOT_FOUND' was raised, but it was not caught
               anywhere along
              the call hierarchy.
              Since exceptions represent error situations and this error was not
              adequately responded to, the running ABAP program
               'CL_METHODCALL_PPF=============CP' has to be
              terminated.
         Error analysis
              An exception occurred that is explained in detail below.
              The exception, which is assigned to class 'CX_OS_OBJECT_NOT_FOUND', was not
               caught in
              procedure "IF_MEDIUM_PPF~EXECUTE" "(METHOD)", nor was it propagated by a
               RAISING clause.
              Since the caller of the procedure could not have anticipated that the
              exception would occur, the current program is terminated.
              The reason for the exception is:
              Could not find the referenced object with the OID
              "00000000000000000000000000000000" (instance GUID) and
              "BECA3BF12720D411AB61009027C3C00A" (class GUID)
         Missing RAISING Clause in Interface
             Program     CL_METHODCALL_PPF=============CP
             Include     CL_METHODCALL_PPF=============CM009
             Row     1
             Module type     (METHOD)
             Module Name     IF_MEDIUM_PPF~EXECUTE
         Trigger Location of Exception
             Program     CL_METHODCALL_PPF=============CP
             Include     CL_METHODCALL_PPF=============CM001
             Row     32
             Module type     (METHOD)
             Module Name     IF_OS_STATE~HANDLE_EXCEPTION
         Source Code Extract
         Line     SourceCde
             2     ***BUILD 020501
             3          " importing I_EXCEPTION type ref to IF_OS_EXCEPTION_INFO optional
             4          " importing I_EX_OS type ref to CX_OS_OBJECT_NOT_FOUND optional
             5     ************************************************************************
             6     * Purpose        : Handles exceptions during attribute access.
             7     *
             8     * Version        : 2.0
             9     *
            10     * Precondition   : -
            11     *
            12     * Postcondition  : -
            13     *
            14     * OO Exceptions  : CX_OS_OBJECT_NOT_FOUND
            15     *
            16     * Implementation : If an exception is raised during attribut access,
            17     *                  this method is called and the exception is passed
            18     *                  as a paramater. The default is to raise the exception
            19     *                  again, so that the caller can handle the exception.
            20     *                  But it is also possible to handle the exception
            21     *                  here in the callee.
            22     *
            23     ************************************************************************
            24     * Changelog:
            25     * - 2000-03-07   : (BGR) Initial Version 2.0
            26     * - 2000-08-02   : (SB)  OO Exceptions
            27     ************************************************************************
            28     * Modify if you like
            29     ************************************************************************
            30     
            31       if i_ex_os is not initial.
         >>>>>         raise exception i_ex_os.
            33       endif.
            34     
            35     endmethod.

  • How to trigger email notification when users fail to reset your password in fim 2010 r2.

    Hi,
    how to trigger email notification when users fail to reset  your password in fim 2010 r2
    Regards
    Anil Kumar

    Hi Sylvain,
    I did all thing as you told me.First i created Criteria based Set after this we created a Workflow type Action and Actvities Type Notifcation Email template and finally i called this Workflow in MPR as Set Transition and call Set that i was created below.and
    check Advance View of Set this gives
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect"
    xmlns="/Request[(Creator">http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Request[(Creator = 'b0b36673-d43b-4cfa-a7a2-aff14fd90522') and (RequestStatus = 'Denied or PostProcessingError')]</Filter>
    But this is not working for me so please tell me where i am wrong.
    Regards
    Anil Kumar

  • How to trigger email notification when users fail to give correct answers to reset your password in fim 2010 r2

    Hi,
    How to trigger email notification when users fail to give correct answers to reset your password in fim 2010 r2
    Senario:I want put wrong answering to the Questions that i was during registration if i give wrong answers to the questions then a Email Notification should be trigger to Users.
    Regards
    Anil Kumar

    Hi Sylvain,
    I did all thing as you told me.First i created Criteria based Set after this we created a Workflow type Action and Actvities Type Notifcation Email template and finally i called this Workflow in MPR as Set Transition and call Set that i was created below.and
    check Advance View of Set this gives
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect"
    xmlns="/Request[(Creator">http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Request[(Creator = 'b0b36673-d43b-4cfa-a7a2-aff14fd90522') and (RequestStatus = 'Denied or PostProcessingError')]</Filter>
    But this is not working for me so please tell me where i am wrong.
    Regards
    Anil Kumar

  • How to trigger a workflow when data inside a table changes

    Hi
    How to trigger a workflow when data inside a table changes ??
    We need to trigger a workflow when STAT2 field value in PA0000 table changes.
    rgds
    Chemmanz

    Make use of Business Object BUS1065. In this business Object you have an attribute Status which you can use. There are a number of events that will get triggered when the status is changed.
    Thanks
    Arghadip

  • How to validate the field when i am populating the data cursor to block

    Hi,
    I am populating data cursor to multi record block.
    Block contain 5 items. I am populating data cursor to block for 4 items. User will enter one item value that is quantity field.
    If user enter negative values and decimal points in quantity filed i need to display message to user item level.
    Please do the needful how to do it.

    902434 wrote:
    Hi,
    I am populating data cursor to multi record block.
    Block contain 5 items. I am populating data cursor to block for 4 items. User will enter one item value that is quantity field.
    If user enter negative values and decimal points in quantity filed i need to display message to user item level.
    Please do the needful how to do it.If you want to validate at entry level then use When-Validate-Item trigger and check the input and show message. Like
    If :quentity <0 then
    message('do not enter negative value');
    message('do not enter negative value');
    raise form_trigger_failure;
    end if;Why u open same thread again ? not closing one.. check this one
    </a>
    How to validate the field when i am populating the data cursor to block
    Hopes this helps
    If someone's response is helpful or correct, please mark it accordingly.

  • How to initiate some action when user clicks a field in CRViewer?

    <p><span style="font-family: Courier"><font size="1">ReportObjects doesn't expose click event despite the fact that a field can get focus frame, you can even tab from field to field. </font></span><span style="font-family: Courier"><font size="1">Drill() event works only on group names.</font></span><span style="font-family: Courier"><font size="1">So, how to initiate some action (based on a clicked field value) when user clicks a field in CRViewer?</font></span><span style="font-family: Courier"><font size="1">After doing some googling, have found that something similar exists but it's FoxPro API</font></span></p><p><strong><span style="font-size: 12pt; font-family: Courier"><font size="1">From some PDF: </font></span></strong><strong><span style="font-size: 12pt; font-family: Courier"><font size="1"> </font></span></strong></p><p><strong><span style="font-size: 12pt; font-family: Courier"><font size="1">> Report objects events</font></span></strong> </p><p style="margin: 0cm 0cm 0pt; line-height: normal" class="MsoNormal"><span style="font-size: 10pt; font-family: Courier"><font size="1"><span style="font-size: 12pt; font-family: Courier"><font size="1"><strong>> </strong></font></span>Report object events occur when you click or double-click a field, </font></span></p><span style="font-size: 10pt; font-family: Courier"><font size="1"><span style="font-size: 12pt; font-family: Courier"><font size="1"><strong>> </strong></font></span>heading, or label in a report.</font></span> <p style="margin: 0cm 0cm 0pt; line-height: normal" class="MsoNormal"><span style="font-size: 10pt; font-family: Courier"><font size="1"><span style="font-size: 12pt; font-family: Courier"><font size="1"><strong>> </strong></font></span>Doing this creates the EventInfo object. This object contains </font></span></p><span style="font-size: 10pt; font-family: Courier"><font size="1"><span style="font-size: 12pt; font-family: Courier"><font size="1"><strong>> </strong></font></span>information about the event and</font></span> <p style="margin: 0cm 0cm 0pt; line-height: normal" class="MsoNormal"><font size="1"><span style="font-size: 10pt; font-family: Courier"><span style="font-size: 12pt; font-family: Courier"><font size="1"><strong>> </strong></font></span>passes as a parameter to the event method. </span><strong><span style="font-size: 10pt; font-family: Courier">Table 3 </span></strong><span style="font-size: 10pt; font-family: Courier">lists the</span></font></p><p style="margin: 0cm 0cm 0pt; line-height: normal" class="MsoNormal"><font size="1"><span style="font-size: 10pt; font-family: Courier"><strong><span style="font-size: 12pt; font-family: Courier"><font size="1">> </font></span></strong>EventInfo object properties.......</span></font></p>

    The article you found refers to the ActiveX viewer which is used with the COM-based tool called Report Designer Component. Since you have posted to the .NET forum, I'm assuming you're not using the RDC and therefore this article will not apply.
    Recently, Click events were added to the Windows Form Viewer to get similar functionality as the ActiveX viewer. Take a look at the following link for more information....
    [http://diamond.businessobjects.com/node/2109 | /node/2109]
    However, if you are using the CR Web Forms Viewer in an ASP.NET app, then this functionality is not available.

  • How to trigger a event when WBS gets changed in Cj02

    Hello,
    I have a requirement where I need to send create an idoc and send the idoc to external system when WBS is created or changed.  Currently, I have the following setup:
       - I have created a YBUS2054 as a subtype of BUS2054 using SWO1
       - YBUS2054 has been delegated to BUS2054
       - created an CHANGED event in the YBUS2054. This event is implemented and then released
       - created a type linkage (object type=YBUS2054, event=CHANGED, receiver type null, and receiver function module = zz_create_wbs_idoc) using SWETYPV. This function is supposed to create an idoc when CHANGED event occurs. I just don't know how to trigger the event to occur.
       - all the port, define idoc type, logical system, and etc are setup
       - when I try to create an entry in "Event for Chagne Document" using SWEC with change doc object=PROJ, business object type = YBUS2054, with on change, I get "Key for change doc object PROJ and business object type YBUS2054 are incompatible".
    I tried various configurations, and I was not successfully in creating an event on CHANGED
    can you please advise what I am missing in getting the changed event to trigger?
    Thank you in advance,
    Shawn

    Hi,
    If the change doc doesnt exist, check if you can create an event using BSVW.
    Also use the event log to see if there are other sap standard events happening.
    I checked the package belonging to CJ02 to see if there is something useable, but didn't find anything: CN_PSP_OPR
    If there are no sap standard ways to get an event, you'll have to find a badi/enhancement spot and include some coding to start the event using fm SAP_WAPI_CREATE_EVENT.
    Kind regards, Rob Dielemans

  • How to trigger an event when a job is cancelled

    Hi,
    Can anyone help me out wid a transaction that will trigger an event when a job is
    cancelled....??
    My scenario is :
    When a job is cancelled (SM37) or in cancelled status  i want notify to certain ppl thru emails.
    How do i go abt doing the same??
    Its Urgent...
    Answers will be rewarded.
    regards,
    Rohan

    Hi,
    please check out the link below it might help you
    http://help.sap.com/saphelp_nw2004s/helpdata/en/71/a8a77955bc11d194aa0000e8353423/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/97d2e8b3-0b01-0010-b787-b8ce558a51c2
    for table name and list of function please check out the links below it will help you
    http://www.erpgenie.com/sap/abap/tables_system.htm
    http://www.sap-img.com/abap/function-list.htm
    **************please reward points if the information is helpful to you**********

  • How to call an action when the user selects a radiobutton

    Hai
    PLease help me in providing the information.
    In my Project i have two radio buttons as
    New
    Asssessment
    when the user selects new button, i want to automatically call an action in the controller(.jpf file)
    Simalarly when he selects the other radio button i need to call a separate action in the controller.
    Remember i dont have the submit button.
    I want to dynamically call an action when the user selects the radio button.
    i dont have any field inthe radio button which actually takes action as an attribute .
    please provide me the necessary

    Hi,
    You can use JavaScript to call the action in interest upon the Radio Button Element Being Selected.Should be simple, and if your controller is part of the portlet dont forget to use the jpfScopeId to asscoiate the controller instance with the one in the portlet.
    Let me know if you have any further questions.

  • How to trigger a workflow when a bank record of an employee is delimited

    Hi Friends,
      I want to trigger a workflow when a bank record of an employee is delimited(Infotype  IT0009). When delimiting the bank info, the old record's ENDDA is changed and a new record is created with the BEGDA. In this case two events are triggered one is BANKDETAIL-CREATED and other one is BANKDETAIL-DELETED.
    Which one should i use to trigger my workflow.
    Note : If we use the creation of new record for triggering workflow, then in case when the record is created for a new employee then the workflow will be triggered. To control this can we check whether there is an existing entry in IT009 for the employee or not. If an entry already exist then trigger the workflow else not. Is this ok? Please advice.

    Hi sapient,
    Here i think none of the events would actually help you in achieving what you want because you want to trigger the workflow when the account is delimited not when the account is either created or deleted.Please look for some other information to trigger your workflow.Will get back to you if i had any ideas.
    Thanks,
    Bhumika

  • How to trigger a workflow when a info record is changed?

    Hello All,
    I would like to trigger a workflow when the conditions from a info record are changed?
    What business object should be used?
    Thanks in Advance
    Rui

    Hi,
    for these kinds of issues,
    foirst check if a uefull event already exists in the system
    for this you first actiave the event trace: SWELS.
    Then you change the info record.
    And then you read the event log with SWEL.
    If there's no event, you may eventually have to create it in an exit with SAP_WAPI_CREATE_EVENT fm
    Kind regards, Rob Dielemans

  • Is there a way to trigger an action on or after a specific date?

    Hi,
    I wanted to set up AS3 to trigger an action on or after specific dates (quarterly, 1/1, 4/1, 7/1, 10/1). Is this possible?
    I can script getting today's date, but I am not sure how to script: if today's date is  greater than or equal to (>=) one of these quarterly dates (greater than is essential since the video may not run on the specified date, so greater than is needed). Year is not needed, since the goal is quarterly action. But, would need to start over each new year, so quarterly action continues each year. Can't seem to get my brain around how to construct this and how to script it.
    Any help appreciated.

    if you can accept the user's date, you can compare the user's date's time property with your date's time property:
    var triggerDate=new Date(2013,0,1);
    var userDate=new Date();
    if(userDate.time>triggerDate.time){
    //do whatever

  • How can I read a binary file stream with many data type, as with AcqKnowledge physio binary data file?

    I would like to read in and write physiological data files which were saved by BioPac�s AcqKnowledge 3.8.1 software, in conjunction with their MP150 acquisition system. To start with, I�d like to write a converter from different physiodata file format into the AcqKnowledge binary file format for version 3.5 � 3.7 (including 3.7.3). It will allow us to read different file format into an analysis package which can only read in file written by AcqKnowledge version 3.5 � 3.7 (including 3.7.3).
    I attempted to write a reader following the Application Note AS156 entitled �AcqKnowledge File Format for PC with Windows� (see http://biopac.com/AppNotes/ app156Fi
    leFormat/FileFormat.htm ). Note the link for the Mac File format is very instructive too - it is presented in a different style and might make sense to some people with C library like look (http://biopac.com/AppNotes/ app155macffmt/macff.htm).
    I guess the problem I had was that I could not manage to read all the different byte data stream with File.vi. This is easy in C but I did not get very far in LabView 7.0. Also, I was a little unsure which LabView data types correspond to int, char , short, long, double, byte, RGB and Rect. And, since it is for PC I am also assuming the data to be written as �little endian� integer, and thus I also used byte swap vi.
    Two samples *.acq binary files are attach to this post to the list. Demo.acq is for version 3.7-3.7.2, while SCR_EKGtest1b.acq was recorded and saved with AcqKnowledge 3.8.1, which version number is 41.
    I would be grateful if you someone could explain how to handle such binary file stream with LabView and send an example to i
    llustrate it.
    Many thanks in advance for your help.
    Donat-Pierre
    Attachments:
    Demo.acq ‏248 KB
    SCR_EKG_test1b.acq ‏97 KB

    The reading of double is also straight forward : just use a dble float wired to the type cast node, after inverting the string (indian conversion).
    See the attached example.
    The measure of skin thickness is based on OCT (optical coherent tomography = interferometry) : an optical fiber system send and received light emitted to/back from the skin at a few centimeter distance. A profile of skin structure is then computed from the optical signal.
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Read_AK_time_info.vi.zip ‏9 KB

  • How can I read a binary file stream with many data type, as with AcqKnowled​ge physio binary data file?

    I would like to read in and write physiological data which was saved by Biopac�s AcqKnowledge 3.8.1 software, in conjunction with their MP150 acquisition system. To start with, I�d like to write a converter from different physiodata file format into the AcqKnowledge binary file format for version 3.5 � 3.7 (including 3.7.3). It will allow us to read different file format into an analysis package which can only read in file written by AcqKnowledge version 3.5 � 3.7 (including 3.7.3).
    I attempted to write a reader following the Application Note AS156 entitled �AcqKnowledge File Format for PC with Windows� (see http://biopac.com/AppNotes/app156FileFormat/FileFo​rmat.h
    tm ). Note the link for the Mac File format is very instructive too - it is presented in a different style and might make sense to some people with C library like look (http://biopac.com/AppNotes/app155macffmt/macff.ht​m) .
    I guess the problem I had was that I could not manage to read all the different byte data stream with File.vi. This is easy in C but I did not get very far in LabView 7.0. Also, because it is for PC I am assuming the data to be written as �little endian� integer, and thus I also used byte swap vi.
    I would be grateful if you someone could explain how to handle such binary file stream with LabView and send an example to illustrate it.
    Many thanks in advance for your help.
    Donat-Pierre

    One more step...
    short are U16 integer
    double are double precision float
    bool seem to be 2 bytes (= U16)
    char are string (variable length)
    rgb are U16 integer, with high order byte = 0
    rect should be 4 x U16 (top, left, bottom, right)
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

Maybe you are looking for

  • HT4972 My music won't erase in the process? I can get it back again?

    I have over 1,000 songs that I do not want to lose!!! But I need to update my iPod touch I can't add any apps since it say I require iOS 5

  • Leslie speed assignment

    I'm trying to assign a button in Layout Mode so that I can assign the Leslie switch on my Nord E3 to change Leslie speeds in EVB3. It appears to Assign and work properly in Layout Mode.  When I switch to Edit to play, it won't switch.  the light just

  • Trouble uploading pictures to website

    I try to upload pictures to my webiste to the server, but the webpage just shows an empty box with no picture when displayed in IE. I tried saving the images for web in Photoshop, but that didn't seem to work. Any ideas?

  • How do I fix this error with MSVCR80.dll

    I keep getting an error message saying  MSVCR80.dll is missing. Please help.

  • Reg alter table move statement

    Hi friends, I am having a table with 10GB. i moved the table to the same tablespace using "alter table move" statement. previously my tablespace had 6 GB freespace. To move the table i resized datafile to increase freespace in tablespace. after movin