How to implement this function in JSP/Servlet env?

Hi all,
I working on a project, it provides functionality to upload file using JSP/Servlet. In the first JSP page, there is file location and submit button. After user select a file to upload and click submit button, a message, like "sending file to XXXX", will be shown on the screen. Once uploading and validation are done on the server-side, a successful/error msg will be shown to user.
Here I have a question for the "sending..." msg and the successful/error msg. They should be put in one jsp page or in two separate page? how to implement them?
Thanks for any help!
Tranquil

For the sending message... Well, the thing is, when you click submit, it's sending the file to the server and the server is processing it, and this is all done before the "complete" page is sent to the server. So one would need to use some Javascript on the page before the actual submit happens to show some message. This is done on Ebay when you put something for sale, you can upload an image, and there is a little popup message telling you that it's uploading, and it is removed when the process is done. Now, I'm not sure the exact details of how this works, but my educated guess is this:
1) The onsubmit function of the form checks that the file upload fields have a value (no need to popup a message if no file upload, since that's what usually takes the time, although it could just be assumed there is a file). If a file is to be uploaded, or just want to show the message anyway, a new popup window is opened with the window.open method and the "sending" message is shown (either written via Javascript or just load a small web page to the window).
2) The popup window, since you can't transfer the window object from the form page to the next page, has to check window.opener for some value that the success/error page would have to set. The success/error page could use it's body onload function to set a variable in it's own window object to denote that the page is loaded. The popup window can use a looping check using setTimeout or setInterval in Javascript to check for window.opener.isLoadedVariable to be present, and if so, close itself.
I've never done that, but I see no reason why it wouldn't work.

Similar Messages

  • How to implement this functionality?

    hi,
    I want to use a thread to send all message centrally. The thread will check if the internal queue is empty. If the queue isn't empty, it sends the message, otherwise, it yields. The code snippet is as the following.
      public void run()
        logger.info("Sending thread started.");
        try{
          while (isConnected) {
            if (!bufferQueue.isEmpty() && !isReconnecting) {
              sendMsgInternal();
            } // bufferQueue.isEmpty()
            else {
              Thread.yield();
        catch (Exception e)
          logger.error("Fatal exception in sending thread", e);
          isConnected = false;
        finally
          sendThread = null;
      }This method works fine. But I found the CPU occupying rate is always 100%.
    Can somebody give me the better method to implement this logic with lower CPU occupying rate??
    Thanks in advance!
    Regards,
    Jason

    I think i have gotten the solution. It shouldn't use yield() method. It waste so much CPU time.
    I think the solution is using wait() and notify() in pair. The snippet code is as the following:
       public final synchronized void send(Object m) {
          if (m == null) {
             System.err.println("null message passed to send()");
             throw new NullPointerException();
          numMessages++;
          messages.addElement(m); // at end
          if (numMessages <= 0) notify();
       public final synchronized Object receive() {
          Object receivedMessage = null;
          numMessages--;
          if (numMessages < 0) {
             while (true) {     // we must be notified not interrupted
                try {
                   wait();
                   break;       // notify(), so get message
                catch (InterruptedException e) {
                   System.err.println
                      ("receive(): InterruptedException, wait again");
                   // race condition fix, see Semaphore.java
                   if (numMessages >= 0) break;
                   else continue;    // no message yet
          receivedMessage = messages.firstElement();
          messages.removeElementAt(0);
          return receivedMessage;
       public void run()
         logger.info("Sending thread started.");
         try{
           while (isConnected) {
               sendMsgInternal(receive());
         catch (Exception e)
           logger.error("Fatal exception in sending thread", e);
           isConnected = false;
         finally
         { // Set to null, avoid restarting the thread.
           sendThread = null;
       }For the details of this method, please refer to the following link:
    http://www.cs.drexel.edu/~shartley/ConcProgJava/messaging.html
    If there are some drawbacks, please let me know.
    Regards,
    Jason

  • Eclipse: UFL "u212com.dll" that implements this function is missing

    Dear Sirs,
    I try to open one of our reports with the "Crystal Reports for Eclipse 2.0" sample application. Thie report relies on a com based UFL. I get the following error message:
    Crystal Reports Viewer
    Exception yadada...
    UFL "u212com.dll" that implements this function is missing
    OK
    How can I fix this?
    Thanks for your answers.

    The fact that you can see the UFL under 'Additional Functions' tells me that the UFL is compiled as 32 bit. This is good for creating the report in the IDE which is 32 bit. But the app you are building is compiled as 64 bit. But there is no 64 bit UFL(?) that yo have built so far. So, two options;
    1) Build the UFL as "Any CPU". I am not sure if this will actually work. never tried this, but I do know that it is not possible to compile an app using the CR runtime as "Any CPU". E.g.; we always recommend to compile either as 32 bit and \ or 64 bit, not "Any CPU" This may be the case with the UFL, thus the next suggestion.
    2) Compile a second copy of the UFL as 64 bit. You'll then have to use 64 bit GAC and regasm on that dll.
    - Ludek

  • "UFL 'u2ltdate' that implements this function is missing."

    I am working through migrating older reports from a very outdated version of Crystal into a newer version and trialing Crystal Server 2013 with Crystal Reports for Enterprise.  The only problem I am running into is that I have many reports using the NumberToDate function to pull a number string and form it into a date for the report.  I really need this function to work because we rely on it quite heavily.  When I pull reports that use it into my new environment I am given the following error:
    "UFL 'u2ltdate' that implements this function is missing."
    I have found the u2ltdate.dll on the web and transferred it into the following folders: windows/system32 and program files(x86)/SAP BusinessObjects/SAP BusinessObjects Enterprise XI 4.0/win32_x86 and the win64_x64 as well just to be sure.  But to no avail I am still unable to use the NumberToDate function.  I have even tried copying the u2ltdate.dll from our older server, and this doesn't work either.  I really need to get this working as soon as possible.    I don't know if I need a 64 bit dll because it is windows server 2008 or if I don't have it in the right places.  Please help!

    Hi Warre,
    Don't put the ufl into the \windows\system32 folder. Nothing should go there now.
    I doubt this will ever work in CR for Enterprise. It's a Java Designer so the only way to make it work is to create a Java UFL.
    Search for this KBA:
    1803967 - How to make a Java UFL available in Crystal Reports 2011 Designer?
    Same for CR for Ent., you need a Java UFL.
    Only way to make this work is to convert the UFL to Java or use Crystal Reports 2011 or 2013.
    See this MS Forum post I responded to also:
    Custom Crystal DLLs with Crystal Reports 2008 for Visual Studio Run Time
    And this one:
    http://scn.sap.com/docs/DOC-35036
    And this one:
    Java UFL and VB UFL
    Try searching, there is a kbase article with a sample attached.
    And you will need a 64 bit version because some of the report processing servers may be 64 bit only but I believe the Crystal Report Processing Server is 32 bit only. It will need the UFL copied into it's \win32_x86 folder.
    Only issue you should have is using CR for Ent. to design/update/create the reports with that function. Use CR 2011 or 2013 and it should work.
    Problem is we no longer have the source code for that UFL and others, quite often they were written by Support people and therefore not saved into our code source system.
    Don

  • How to implement this aggregate logic at target column in odi inteface mapp

    sum(NOTICES) over ( partition by property order by RELAVANTDATE range between interval '30' day preceding and current row)
    how to implement this aggregate logic at target column in odi inteface mappings

    Hi
    if you don't want to aggregate try to define a user function
    analytic_sum($(value))
    implémented by
    sum($(value))
    after that
    replace your
    sum(NOTICES) over ( partition by property order by RELAVANTDATE range between interval '30' day preceding and current row)
    by
    analytic_sum(NOTICES) over ( partition by property order by RELAVANTDATE range between interval '30' day preceding and current row)

  • How to implement Breadcrumb functionality in weblogic portal 10.3

    Hi,
    We need to implement the breadcrumb functionality in weblogic portal 10.3.
    Tried to look for it in Google. But couldn't get success.
    Can someone help on how to implement this.
    Thanks
    Uttam

    Please find the example code for Breadcrumbs
    <%
         ArrayList breadcrumbTitles = new ArrayList();
         ArrayList breadcrumbURLs = new ArrayList();
         BookPresentationContext book = BookPresentationContext.getBookPresentationContext(request);
    PagePresentationContext pageCtx = PagePresentationContext.getPagePresentationContext(request);
         if(pageCtx.getDefinitionLabel() != null )
              breadcrumbTitles.add(pageCtx.getTitle());
              breadcrumbURLs.add(PageURL.createPageURL(request, response, pageCtx.getDefinitionLabel()).toString());
         if (!(book.getDefaultPage().equals(pageCtx.getDefinitionLabel())))
              breadcrumbTitles.add(book.getTitle());
              breadcrumbURLs.add(PageURL.createPageURL(request, response, book.getDefaultPage()).toString());
         else
              breadcrumbTitles.add(book.getTitle());
              breadcrumbURLs.add(PageURL.createPageURL(request, response, pageCtx.getDefinitionLabel()).toString());           
              PagePresentationContext parentPage = book.getParentPagePresentationContext();           
              while (parentPage != null)
                   breadcrumbTitles.add(parentPage.getTitle());
                   if (parentPage instanceof BookPresentationContext)
                        BookPresentationContext parentBook = (BookPresentationContext)parentPage;
                        // condition for not showing my eagle page when user not logged in. instead show default home page
                        if (parentBook.getDefaultPage().equalsIgnoreCase(""))
                             breadcrumbURLs.add(PageURL.createPageURL(request, response, ""));
                        }else
                             breadcrumbURLs.add(PageURL.createPageURL(request, response, parentBook.getDefaultPage()).toString());
                   else
                        breadcrumbURLs.add(PageURL.createPageURL(request, response, parentPage.getDefinitionLabel()).toString());
                   parentPage = parentPage.getParentPagePresentationContext();
    %>
         <ul class="breadcrumbs">
    <%
                   // compare if current page is selected. then dont show hyper link
                   if (pageCtx.getTitle().toString().equalsIgnoreCase((String)breadcrumbTitles.get(i)))               
    %>
                             <%=breadcrumbTitles.get(i)%>  
    <%          
                        }else
    %>                    
                             <a href="<%=breadcrumbURLs.get(i)%> "><font color="#005596"><%=breadcrumbTitles.get(i)%></font></a></b><img src="<render:getSkinPath imageName="/spacer.gif" />" width="2" /><img align="bottom" src="<render:getSkinPath imageName="/arrow_right.gif" />" />
                             <%
    %>
         </ul>

  • How to realize print function in JSP

    How to realize print function in JSP? I know use Javascript:window.print() can print,but it will print whole page,it don't fit me;Another method is to write JSP into Excel and then print it in Excel,but it don't fit me too,because it don't print directly. Anybody know how to print it directly?

    Many websites offer a "printer friendly" version of a certain page. That IMO is the only way to solve your problem, next to using CSS to use a different style for printer output. Here is a tutorial that covers this:
    http://www.alistapart.com/stories/goingtoprint/

  • How to implement avg function in answers or RPD

    hi,
    I need to implement this function in obiee answers or RPD..how can i do that.. please help me
    AVG(SAS.SHIPPED_QTY) OVER (ORDER BY SAS.ACCOUNT_MONTH_NO
    ROWS BETWEEN 12 PRECEDING AND 1 PRECEDING) AVG_QTY_SALES,
    thanks in advance

    Hi,
    I think you are trying to use a sql server window function here. If you are, then you could push this function to the DB itself, using EVALUATE() in OBIEE.
    Hope this helps.
    Thank you,
    Dhar

  • How to implement copy functionality in advanced table

    hi all, i have a advanced table with some data populated, all the rows has a checkbox where the user can select the rows which he wants, my requirement is how to implement copy functionality, i,e i need to show the same set of rows which the user selected in the same advanced table. can any one give me an idea of how to do this

    You can copy the key of the selected rows to the copy page and based on those keys render the rows. On this copy page, once user commits after any modification to data, read those rows and save with new keys.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to create RFC function module and how to call this function module

    Hi,
    i want to know step for creating RFC function module and then How to  use this function module from some other sap system.
    Thnaks,
    jigar

    Jigar,
    To implement a remote function module in ABAP, perform the following steps:
    Register the module as remotely callable in the RFC server system.
    In the function module Administration screen (transaction code SE37), set the field Can be called via REMOTE CALL. Registering a module as remote causes an RFC stub to be generated for it.
    Write the code for the function module.
    Create the destinations.....................
    Displaying, Maintaining and Testing Destinations
    To display, create or modify destinations, choose Tools ® Administration ® Administration ® Network ® RFC destinations or enter transaction code SM59.
    Remote Destinations are stored in table RFCDES. The RFCDES table describes logical destinations for remote function calls.
    It is not possible to maintain the RFCDES table directly.
    You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® AcceleratedSAP ® Customizing ® Execute Project ® SAP Reference IMG.
    In the Implementation Guide, expand the following hierarchy structure:
    Basis
    Application Link Enabling (ALE)
    Sending and Receiving Systems
    Systems in Network
    Define Target Systems for RFC Calls
    Displaying Destinations
    The initial screen for this transaction displays a tree:
    Different connection types (i.e. partner systems or programs) are possible. For further information, see Types of Destinations.
    To display all information for a given destination, double-click it, or place the cursor on it and press F2 .
    To search for a destination, press the Find button and specify your selection. You get a list of all entries matching your selection. Place the cursor on the one you want, and press F2 or simply double-click the destination. All information for the given entry appears.
    Creating Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    All available connection types are explained in Types of Destinations.
    To create a new RFC destination, press the Create button. A new screen is displayed with empty fields for you to fill in.
    If you want to create a new destination
    As you create a remote destination, you can specify a particular application server or a group of servers for a balanced distribution of system load.
    For details of the destination parameters, see Entering Destination Parameters.
    Changing Existing Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    You can display all information for a given destination by double-clicking it or pressing F2 on it.
    To change an existing destination, double-click it, or place the cursor on it and press the Change button.
    For details of the destination parameters, see Entering Destination Parameters.
    Testing Destinations
    To test a destination, choose the appropriate function from the Test menu.
    Connection (also available via the Test connection pushbutton)
    Authorization (checks logon data)
    Local network (provides a list of application servers)
    You can use the CALL FUNCTION statement to call remote functions, just as you would call local function modules. However, you must include an additional DESTINATION clause to define where the function should run:
    CALL FUNCTION RemoteFunction
    DESTINATION Dest
    EXPORTING
    f1 =...
    f2 =...
    IMPORTING
    f3 =...
    TABLES
    t1 =...
    EXCEPTIONS......
    The field Dest can be either a literal or a variable: its value is a logical destination (for example, "hw1071_53") known to the local SAP System. Logical destinations are defined in the RFCDES table (or the TRFCD table in R/2 Systems) via transaction sm59 or the following menu path: Tools ® Administration, Administration ® Network ® RFC destinations. You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® Customizing ® Enterprise IMG. In the Implementation Guide, you can then choose Cross-application components ® ALE ® Communication ® Define RFC destination.
    The remote function call concept, for example, allows you to access a function module in an R/2 System from an ABAP program in an R/3 System. If you want to read a customer record from your R/2 System’s database, create a remotely callable function module in the R/2 environment which retrieves customer records. Call this function from your R/3 System using a remote function call and listing the destination for the target R/2 System:
    Pls. reward if useful

  • How to implement Table Function Operator?

    Hello All,
    Can some one post me the steps on how to implement this table function operator ??
    Thanks ...

    I don't know what else to say then that what's writen in help (F1):
    To define a Table Function operator in a mapping:
    Before you deploy the mapping containing the Table Function operator, you must manually create the table function in the target warehouse. The Table Function operator is bound to the actual table function object through the code generated by the mapping.
    1. Drag and drop a Table Function operator onto the Mapping Editor canvas. A table function operator called TABLEFUNCTION is added to the Mapping Editor canvas.
    2. Connect the appropriate source attributes to the input group of the table function operator.
    3. Right-click the Table Function operator and select Open Details. The Table Function Editor is displayed.
    4. From the Groups tab, select Add to add an output group

  • How to implement AI_Change_Parameter function?

    Hi, everyone, I just bought a NI 4472 DSA board, and want to enable IEPE excitation for a channel for connecting a ICP Accelerometer, but I do not have LabView, only use MATLAB, I don't know how to implement  AI_Change_Parameter function in the matlab? I know the devNum is 1 and chanNum is 2, then directly use this function {AI_Change_Parameter (1, 2, ND_DSA_EXCITATION, ND_ON) } in MATLAB, it does not work, could you please let me know what is the problem and how can I use this AI_Change_Parameter function?
    Another question: I checked here and found that the amplifier gain for this NI 4472 DAS board can NOT been adjusted, is that true? I just plan to amplify the signal before it goes to MATLAB.
    Thanks.

    Hi,
    In regards to your question on the amplifier gain, you are correct, there is only 1 range setting on the 4472.
    In regards to you question on programming Traditional NI-DAQ in Matlab, this shuold be handled on your post on the Multifunction DAQ forum to get the most help from other users with similar experience.
    Have a great day!
    Travis W

  • How to use this function in crm5.2 -   /CEM/ENT_IMPORT_DATAFROMEXCEL

    i am having a problem regarding how to use this function to import values from an excel sheet.
    in call funtion what to specify at place of ct_ent_action = ?
    CALL FUNCTION '/CEM/ENT_IMPORT_DATAFROMEXCEL'
      CHANGING
        CT_ENT_ACTION       =
    EXCEPTIONS
      FILE_ERROR          = 1
      IMPORT_ERROR        = 2
      OTHERS              = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    Hi
    The use of Standard Parner functions are as follows:
    1. Ordering Address (OA): The PO will be sent this vendor and not the main vendor.
    2. Goods Supplier (WL): In case of return deliveries, Goods will be returned to thsi vendor's address
    3. Invoicing party (RS): The payment will be made to this vendor.
    Hope this clarifies.
    Thansk

  • UFL 'u212com.dll' that implements this function is missing

    I am attempting to write a user function library for the crystal reports version that ships with Visual Studio 2010. Following the walkthrough on the Business Objects website (although that is for VS2005) I have successfully created my .dll file and added it to the GAC, and it appears in the function list under 'Additional Functions' in the Crystal Reports formula editor. However when I use the function on in my Windows forms application, I get the error "UFL 'u212com.dll' that implements this function is missing.". This is on my development machine and I have installed the latest service pack for Crystal Reports for VS2010 (64-bit). My OS is Windows 7 64-bit.
    I have two questions:
    1)  What version of the .NET framework should my class library be targeting? My windows forms application targets the .NET framework version 4, but should I be doing the same thing for the .dll for Crystal Reports? It does show up in the formula editor though, so I guess that means that Crystal Reports recognises it correctly.
    2) I have done a search on the PC for the file 'u212com.dll' and it is in the folder C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64 (and also in the equivalent 32-bit folder) Is this correct, or is there is a specific 64-bit version of this file?
    Or is it something else that I am missing? Thanks in advance for any suggestions.

    The fact that you can see the UFL under 'Additional Functions' tells me that the UFL is compiled as 32 bit. This is good for creating the report in the IDE which is 32 bit. But the app you are building is compiled as 64 bit. But there is no 64 bit UFL(?) that yo have built so far. So, two options;
    1) Build the UFL as "Any CPU". I am not sure if this will actually work. never tried this, but I do know that it is not possible to compile an app using the CR runtime as "Any CPU". E.g.; we always recommend to compile either as 32 bit and \ or 64 bit, not "Any CPU" This may be the case with the UFL, thus the next suggestion.
    2) Compile a second copy of the UFL as 64 bit. You'll then have to use 64 bit GAC and regasm on that dll.
    - Ludek

  • How to Use this function

    I am not sure how to call this Function correctly and how to pass the IN parameter, I am still new and learning, please help!
    So far I have compiled it, and it compiled fine and saved it in my schema.
    It is supposed to be able to calculate the compression ratio for say TABLE_1234 to see how much space it would save if
    I used the COMPRESS option in 10G.
    CREATE OR REPLACE function Y775.compression_ratio (tabname varchar2)
    return number is
    pragma autonomous_transaction;
    -- sample percentage
    pct number := 0.000099;
    -- original block count (should be less than 10k)
    blkcnt number := 0;
    -- compressed block count
    blkcntc number;
    begin
    execute immediate ' create table TEMP_UNCOMPRESSED pctfree 0
    as select * from ' || tabname ||
    ' where rownum < 1';
    while ((pct < 100) and (blkcnt < 1000)) loop
    execute immediate 'truncate table TEMP_UNCOMPRESSED';
    execute immediate 'insert into TEMP_UNCOMPRESSED select * from ' ||
    tabname || ' sample block (' || pct || ',10)';
    execute immediate 'select
    count(distinct(dbms_rowid.rowid_block_number(rowid)))
    from TEMP_UNCOMPRESSED' into blkcnt;
    pct := pct * 10;
    end loop;
    execute immediate 'create table TEMP_COMPRESSED compress as
    select * from TEMP_UNCOMPRESSED';
    execute immediate 'select
    count(distinct(dbms_rowid.rowid_block_number(rowid)))
    from TEMP_COMPRESSED' into blkcntc;
    execute immediate 'drop table TEMP_COMPRESSED';
    execute immediate 'drop table TEMP_UNCOMPRESSED';
    return (blkcnt/blkcntc);
    end;
    /

    Ok, ok - so I have updated the function and it compiled, fine, but now nothing is returned, I thought that a number was returned ?
    CREATE OR REPLACE function Y775.compression_ratio (tabname varchar2)
    return number
    AUTHID CURRENT_USER
    is
    pragma autonomous_transaction;
    -- sample percentage
    pct number := 0.000099;
    -- original block count (should be less than 10k)
    blkcnt number := 0;
    -- compressed block count
    blkcntc number;
    begin
    execute immediate ' create table TEMP_UNCOMPRESSED pctfree 0
    as select * from ' || tabname ||
    ' where rownum < 1';
    while ((pct < 100) and (blkcnt < 1000)) loop
    execute immediate 'truncate table TEMP_UNCOMPRESSED';
    execute immediate 'insert into TEMP_UNCOMPRESSED select * from ' ||
    tabname || ' sample block (' || pct || ',10)';
    execute immediate 'select
    count(distinct(dbms_rowid.rowid_block_number(rowid)))
    from TEMP_UNCOMPRESSED' into blkcnt;
    pct := pct * 10;
    end loop;
    execute immediate 'create table TEMP_COMPRESSED compress as
    select * from TEMP_UNCOMPRESSED';
    execute immediate 'select
    count(distinct(dbms_rowid.rowid_block_number(rowid)))
    from TEMP_COMPRESSED' into blkcntc;
    execute immediate 'drop table TEMP_COMPRESSED';
    execute immediate 'drop table TEMP_UNCOMPRESSED';
    return (blkcnt/blkcntc);
    end;
    /

Maybe you are looking for

  • Controling IP addressed used to issue HTTP request

    Hi, We are looking for a way to control the IP address we use for outgoing HTTP requests so that we can choose between two IP addresses we will have on a linux server. We have a Linux server running Java/Tomcat which is making HTTP GET requests to We

  • Is it Possible to do easy cost planning in network and acitivity level

    Hi, Is it possible to do easy cost planning in network and acitivity level Rgds Purna.M

  • Passwords not saved

    When I enter a user name and password, Safari usually asks if I want to remember it, or gives me the option "Never for this site." How do I know what it is set to do? If I click never, do I just never ever have the option to save a password again? Ho

  • Accrual run and  revenue recog( time related revenue recognition)

    Hi All, Please let me know  what are the configuration steps required to  perform accrual run and  revenue recog( time related revenue recognition)  in R/3 when we do billing in CRM , for service contracts  with start date and end date  and billing p

  • Feedback in a survey

    Today performance was bad.  Most of my posts had to be cloned in order to be Submitted successfully.   The UX for retry needs to be improved.  Few posters will understand cloning and then will probably abandon their post with much hard feelings towar