Dowload file using popup window

My JSP page mutiple download buttons. On clickof this button i am opening a popup window which calls the download servlet. The system can be used by mutilple users. Due to download memory limitatons, only one user can be allowed to download at a time in the servlet. My requirement is, when the download is going on for one user,and when other users try to download the file, i need to show busy screen for them and soon as the first user download completes, the next download from the pool should start automatically by replacing the busy window. Plz suggest me if you have any idea.

I have one abstract idea for this. Create one more servlet for controlling purpose. Let the clients to contact this servlet for the file. If the real servlet is free then it will forward it to real one else it will send some response to client which indicates server busy. In this response put some client side script to send the request for every 10 sec( it should be decided by u this time frame). Make sure that your controlling servlet maintain some data to identify the older request. Pass the older request to the original servlet once real servlet is free.
i had similar solution, it was working fine for single client. When i was testing fro multiple concurrent customers, the popup windows behaviour was unexpected. Let us say, i opened 4 broser instances and cliked on 4 webpages download buttons. As per my implementation the first cliked one started downloading and for other users i am showing busy popup window. As soon as the first one finished downloading, the either of 3 waiting requests will be served in the pool. For the one whose download slot available, the new window will be opened with download servlet and i am closing the busy popup window for that client. This goes on like this. During the process sometimes, i am getting the same file downloaded for 2 clients. The first download works fine, no problem. The second download also works fine, but when thid download starts, insted of opening for separate window for download, it shows the same file which downloaded for second client or browser. I am pasting here below the code which i am working on.
boolean firstTime = true;
boolean firstTimeFuserAvailable = true;
Object parserLock = new Object();
java.io.PrintWriter out = null;
while (true){
     System.out.println("\nTrying to get fuser for vehicle id:"+vehicleId);
     synchronized(parserLock){
          if (mdfDataDownload.isFuserAvailable()){
               MDFFuser mdfFuserInstance = MdfFuserPool.getInstance().checkOut();
               session.setAttribute("mdfFuserInstance", mdfFuserInstance);
               System.out.println("\nGot Fuser for vehicle Id:"+vehicleId);
               if (firstTimeFuserAvailable){
                    System.out.println("\nForwarding the request for vehicle Id:"+vehicleId);
                    rd.forward(request, response);
                    break;
               } else {                                       
                    System.out.println("\nOpening new window download for vehcile Id:"+vehicleId);
                    //set the MIME type of the response to "text/html"
                         //response.setContentType("text/html");
                         //use a PrintWriter send text data to the client
                         //java.io.PrintWriter out = response.getWriter();
                         //output the HTML content
                         out.println("<html><head>");
                         out.println("<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>");
                         out.println("<LINK rel='stylesheet' href='/FCDA_CARS_DCC/theme/dcx_fixed/css/master.css' type='text/css'>");
                         out.println("<LINK rel='stylesheet' href='/FCDA_CARS_DCC/theme/dcx_fixed/css/header.css' type='text/css'>");
                         out.println("<LINK rel='stylesheet' href='/FCDA_CARS_DCC/theme/dcx_fixed/css/icons.css' type='text/css'>");
                         out.println("<LINK rel='stylesheet' href='/FCDA_CARS_DCC/theme/dcx_fixed/css/table.css' type='text/css'>");
                         out.println("<title>Intermediate Page</title></head>");
                         out.println("<script language='JavaScript'>");
                         out.println("var date=new Date();");
                         out.println("var datetime = date.getYear()+date.getMonth()+date.getDate()+date.getHours()+date.getMinutes()+date.getSeconds()+date.getTime()");
                         out.println("window.open('/FCDA_CARS_DCC/FusedMdfDownloadServlet',datetime,'width=700,height=600')");
                         out.println("window.close()");
                         out.println("</script>");                         
                         out.println("");
                         out.println("</div></div></body></html>");
                         out.flush();
                         break;
          } else {                                  
               firstTimeFuserAvailable = false;                              
               if (firstTime){
                    System.out.println("\n Opening first time window for vehicle id:"+vehicleId);
                    //set the MIME type of the response to "text/html"
                         response.setContentType("text/html");
                         //use a PrintWriter send text data to the client
                         out = response.getWriter();
                         //output the HTML content
                         out.println("<html><head>");
                         out.println("<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>");
                         out.println("<LINK rel='stylesheet' href='/FCDA_CARS_DCC/theme/dcx_fixed/css/master.css' type='text/css'>");
                         out.println("<LINK rel='stylesheet' href='/FCDA_CARS_DCC/theme/dcx_fixed/css/header.css' type='text/css'>");
                         out.println("<LINK rel='stylesheet' href='/FCDA_CARS_DCC/theme/dcx_fixed/css/icons.css' type='text/css'>");
                         out.println("<LINK rel='stylesheet' href='/FCDA_CARS_DCC/theme/dcx_fixed/css/table.css' type='text/css'>");
                         out.println("<title>Error Page</title></head><body>");
                         out.println("<div class='wrapper'>");
                         out.println("<div class='mainborderless'>");
                         out.println("");
                         out.println("");
                         out.println("Please wait while fusing starts....");
                         out.println("");
                         out.println("");
                         out.println("</div></div></body></html>");
                         out.flush();
                         firstTime = false;
               try{
                    Thread.sleep(2000);
               }catch(InterruptedException e){
                    System.out.println("Interrupted Exception:"+e);
The FusedMdfDownloadServlet is the actual downloading servlet.

Similar Messages

  • How to create a button to get File Open popup window and select a file

    Hi,
    I have an applet that contains Browse button. When user clicks on that, a File Open popup window should be displayed to enable user to select the input file. This file path should be given back as parameter.
    How to do this? I have tried using LoadFileData but not able to get the desired result.
    Any pointers would be helpful.
    Thanks,
    Lalitha Dandibotla

    Do you need only the path or also the file back into Siebel?
    If you need both, the have a look at any attachment applet, that will give you a good start.
    Are you using Siebel in High Interactivity (HI) Mode or Standard Interactivity (SI) Mode?
    If you are in SI Mode have a look at the html type
    <input type="file">
    http://www.w3.org/TR/html401/interact/forms.html#h-17.4
    Axel

  • Dowload file using ftp in bash script

    Hi! I'm runnig a bash script in solaris i want within the script to dowload file using ftp
    How can i do it?
    Tanks a lot

    hello,evgchech
    please try this way:
    1. In the bash script, try following command:
    ftp -n < ftpcmdfile2 in the ftpcmdfile (which is a file),coding the interactive commands of FTP such as:
    user anonymous  [email protected]
              cd /var/sun/download
              bi
              mget *.*
              bye
         try it and good luck!
    Wang Yu
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • To load a pdf file in popup window using flex

    Hi All,
    Can anyone send me the code for loading pdf file in a popup
    window using flex.
    Regards,
    Dharma

    try this action script
    var pdfUrl:URLRequest = new URLRequest("assets/file.pdf");
    navigateToURL(pdfUrl,"_blank");

  • DW 8 to play swf file in popup window

    The swf file plays fine with the source file (flv) on
    streaming server. see page
    http://www.jobclub.com/testing/healthcare.html
    Open Employment Video Profile in center. All I want to do is to
    have iit play in a popup window.
    But I cannot figure out how to play the swf file in a popup
    window
    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"
    <script type="text/javascript">
    AC_FL_RunContent( 'codebase','
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','wid th','285','height','231','title','HealthSouth','src','eva/evaemp/HC240','quality','high',' pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=Shockwa veFlash','movie','eva/evaemp/HC240'
    ); //end AC code
    </script><noscript><object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"
    width="285" height="231" title="HealthSouth">
    <param name="movie" value="eva/evaemp/HC240.swf" />
    <param name="quality" value="high" />
    <embed src="eva/evaemp/HC240.swf" quality="high"
    pluginspage="
    http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
    type="application/x-shockwave-flash" width="285"
    height="231"></embed>
    </object>
    </noscript>
    Thanks
    Mat Media

    Do you really want to open a new window, or do you just want
    to show a hidden layer that looks like a pop-up?

  • Solution: Using Popup Windows in JSF Applications

    URL: http://forum.exadel.com/viewtopic.php?t=559
    This example shows:
    * how to use a client-side script to control a form field rendered by JSF
    * how to launch a popup window and return a result back to the main window
    * how to use the standard JSF Navigation Framework for navigation in a multiple-windows interface environment.

    It works only with latest ( jsf-ri beta ) version. EA4 used to require completely another approach to do the same.
    According to diagnostic message, you have problem with running jsf-ri itself, but now with this example application.
    There is a good test to examine that your environment is ready to work with jsf-ri: jsf-ri is shipped along with demo-components.war example. Try to deploy it. If it works, jsf-popup example should work also.
    Perhaps, your servlet container does not with servlet-mapping like *.jsf . I met this problem couple time when play with standard jsf-ri examples. So, you can try to replace *.jsf with /faces/* and index.jsp should contain <jsp:forward page="faces/pages/inputdata.jsp" /> in this way.
    Finally, I have received several request about working with WSAD 5.1 . It looks like 5.1 does not support jsf-ri applications at all. This is a link that explains the problem: http://forum.java.sun.com/thread.jsp?forum=427&thread=476773 . If somebody knows the solution let's us know, please.

  • Locked files using a Windows 2003 File Server with Mac 10.6 clients running CS5

    We migrated 40 Mac users from OS X 10.5/CS3 to OS X 10.6/CS5 back in November. Our InDesign files are kept on a Windows 2003 file server.
    We have had fairly constant complaints of InDesign and Photoshop files being reported as locked when users try to save their work back to the server. This did not occur as frequently with CS3.
    Has anyone else had this issue?

    I'd suggest starting with iFelix's Sharing files between a Windows XP PC and a Mac running OS 10.4.x

  • Trying to Create a Catalog file using WSIM (Windows System Image Manager)

    I have been looking online for a solution to htis problem for days and come up with nothing so any help would be amazingly helpful.
    I have created a Windows 8.1 image which I would like to role out to all users within my company but when trying to create a catalog file I am getting an erorr message saying "Windows SIM was unable to generate a catalog."  It says "Mounting
    Windows Image file......This might take a few minutes" and then fails after 6-7mins.
    When opening the log file I get this:
    10:00 : Cannot obtain read/write access for F:\sources\install.wim.
    In order to generate a catalog file, you must have read/write access to the Windows image file and its containing folder.
    10:13 :
    10:13 : Windows SIM was unable to generate a catalog. For troubleshooting assistance, see the topic: 'Windows System Image Manager Technical Reference' in the Windows OPK or Windows AIK User's Guide.
    10:13 :
    10:13 : System.InvalidOperationException: The operation failed to complete. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: String reference not set to
    an instance of a String.
    Parameter name: source
       at System.Globalization.CompareInfo.IsPrefix(String source, String prefix, CompareOptions options)
       at ?A0xfe36268f.ConvertToNtPath(String path)
       at Microsoft.ComponentStudio.ComponentPlatformInterface.CbsSessionAdaptor..ctor(String bootDrive, String imageWinDir, String servicingPath)
       at Microsoft.ComponentStudio.ComponentPlatformInterface.OfflineImageImpl.InitializePackages()
       at Microsoft.ComponentStudio.ComponentPlatformInterface.OfflineImageImpl..ctor(OfflineImageInfo imageInfo)
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)
       at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at Microsoft.ComponentStudio.ComponentPlatformInterface.Cpi.PlatformImplementation.CreateOfflineImageInstance(OfflineImageInfo imageInfo)
       --- End of inner exception stack trace ---
    The one image that did work (LiteTouchPE_x64.wim) was from the OS I imported to Microsoft Workbench but the components are different to any that I have seen online when looking on how to do this.
    I have made sure that the architecture is x64 and tried from ISO files I have on the system already but get the same error.
    This is the first project I have been involved in and only ever done IT support before this.
    Thanks for your help in advance.

    Yes I am trying to capture a reference image that I have created on another machine and then reploy this through MDT. I am trying to open the Unattend.xml file because the "Capture and Sysprep" fails on the reference machine when trying to run
    Sysprep. When I try to open the Unattend.xml file in MDT I get the error below:
    Performing operation "generate" on Target "Catalog".
    Starting: "C:\Program Files\Microsoft Deployment Toolkit\Bin\Microsoft.BDD.Catalog35.exe" "D:\Windows8.1 TEST3\Operating Systems\Windows8.1 x64\Sources\install.wim" 1 > "C:\Users\*****\AppData\Local\Temp\3\Microsoft.BDD.Catalog.log"
    2>&1
    No existing catalog file found.
    PROGRESS: 0: Starting.
    PROGRESS: 0: Creating mount folder: C:\Users\*****\AppData\Local\Temp\3\IMGMGR_install_Windows 8.1 Enterprise_njegg3ph.con.
    PROGRESS: 5: Creating temp folder: C:\Users\*****\AppData\Local\Temp\3\IMGMGR_install_temp_qj0x3ga5.obv.
    PROGRESS: 10: Mounting Windows image: D:\Windows8.1 TEST3\Operating Systems\Windows8.1 x64\Sources\install.wim. This might take a few minutes.
    ERROR: Unable to generate catalog on D:\Windows8.1 TEST3\Operating Systems\Windows8.1 x64\Sources\install.wim: System.ComponentModel.Win32Exception: The process cannot access the file because it is being used by another process
       at Microsoft.ComponentStudio.ComponentPlatformInterface.WimImageInfo.PreCreateCatalog()
       at Microsoft.ComponentStudio.ComponentPlatformInterface.OfflineImageInfo.CreateCatalog()
       at Microsoft.BDD.Catalog.Program.DoCatalog()
    Non-zero return code from catalog utility, rc = 2002

  • Invalid URL Exception while opening a file using external window in webdynp

    I am trying open an URL ythru external window on click of button in my webdynpro.
    This is the URl I am trying to open
    File://mww/Documents/Attachments/2008/10/56254/{FD803B0D-157F-47F9-A5A8-C687E1DC6B96}_break.JPG
    if I try to open from a from the browser it works fine but thru webdynpro it is throwing the error.
    mww is another system where the file is residing.
    But I am using the same techniue in other component where I am able to open file from an external window.
    File://mww/Documents/Attachments/2008/10/56254/some.jpg
    The only difference in  the URL is {FD803B0D-157F-47F9-A5A8-C687E1DC6B96}Since this URL is generated by another system I do not have any other aletrnative but I have live with this URL.
    can some body please give some idea how to fix this
    if I use java.net.URLEncoder.encode() then I am not getting any error , buit file is not opening in the browser( external window)
    below is the error stack I am getting.  
    com.sap.tc.webdynpro.services.exceptions.InvalidUrlRuntimeException: Invalid URL=File://mww/Documents/Attachments/2008/10/56254/{FD803B0D-157F-47F9-A5A8-C687E1DC6B96}_break.JPG
    at com.sap.tc.webdynpro.serverimpl.core.url.AbstractURLGenerator.checkURL(AbstractURLGenerator.java:699)
    at com.sap.tc.webdynpro.services.sal.url.core.URLGeneratorInternal.checkURL(URLGeneratorInternal.java:390)
    at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.createNonModalExternalWindow(ClientComponent.java:1037)
    at com.gis.dcww.findsrch.AttachmentView.onActionOpen_Attachement(AttachmentView.java:179)
    at com.gis.dcww.findsrch.wdp.InternalAttachmentView.wdInvokeEventHandler(InternalAttachmentView.java:203)
    at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
    at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)
    at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
    at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
    at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
    at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    thanks
    PK

    Hi Armin, Josue
    Thanks for the reply
    Please note I am able to open an external window( browser ) thru my code with "File" protocol.
    I have no issue opening an external window or using File protocol.
    I am able to open an image/doc with a normal URL as follows
    File://mww/documents/image.jpg
    or
    File://mww/document/temp.csv
    But My URL has some system( thru Other applications ) generated charaters in it , I need get the path from DB( which I have done ) and pass this URL to the ExternalNonModalWindow as paramter.
    MY code is opening successfully the external  window for any URL .
    but for URL which has these character { }  is throwing the invalid URL error 
    for the below URL, I am getting the error
    File://mww/Documents/Attachments/2008/10/56254/{FD803B0D-157F-47F9-A5A8-C687E1DC6B96}_break.JPG
    thanks
    PK
    because of the flower bracket it is throwing the error.
    thansk
    PK

  • Can't open my .psd file using CS4 windows XP & Mac OSX

    I am using photoshop CS4 on windows XP I cannot open my file. the message reads: Could not complete your request because the version is not compatible with this version of photoshop.
    I did open the file on my mac OSX CS4 as well to try to use some of the fonts installed there. Now the file will not open on either platform. Are there known issues with crossing platforms? I believe the files were always universal before?

    There is normally no problem.
    You failed to mention what format the file had.
    If fonts are missing, it should still open with an error message about the font.

  • How to open files using the Windows associated program?

    I have a LV program that is generating a list of files that I may want to open using the associated Windows program. Some are standard Office files but others require proprietary analysis programs.  All have Windows associations such that I can double click on the file name in the Windows file manager and launch the appropriate program. I would like to mimic this behavior within my LV program but without coding a case for each file extension, some of which I may not anticipate now.

    There are some problems with that VI.  I have one user that I had to track a problem down with trying to open a PDF file.  Their registry key HKEY_CLASSES_ROOT\.pdf was read in with a value of "AcroExch.Document                 " (with a lot of spaces after it), which prevented this VI from finding the next key (AcroExch.Document\shell\open\command) which identifies the path to Adobe Acrobat.  Instead of getting the path to Adobe Acrobat, I got back "Adobe Acrobat 7.0 Document" as the path (see attached error).
    I checked the key with the Windows registry editor, and it did NOT show the extra spaces.  However, just opening the key and selecting OK (without making changes) was enough to clear the problem.
    Not sure if this problem is with the registry keys that Adobe Acrobat created when it was installed or upgraded (the user was on version 9.0, but there are older versions on that machine, too), or if the problem was with the LabVIEW registry key readers in Open a Document on Disk.vi.
    Message Edited by Joe Gerhardstein on 05-13-2009 03:13 PM
    Message Edited by Joe Gerhardstein on 05-13-2009 03:17 PM
    Joe Gerhardstein
    Averna Test Systems
    Certified LabVIEW Architect
    http://www.averna.com
    Attachments:
    Open a Document.jpg ‏82 KB

  • JavaScript error After cancel the file download popup window

    Hi , I am trying to show Document download links in my ADF page. First time it is working file means i able to download linked document. But when I click again on same link to download page then i see only 0 byte file download and when i open the documen then it's showing
    This page uses JavaScript and requires a JavaScript enabled browser.Your browser is not JavaScript enabled.I checked my browser setting and script in enabled...
    Below is the ADF page and backing bean code....
    <af:panelBox text="Pension FAQ's" id="pb1">
    <af:table value="#{bindings.faqsTypeDocumentView1.collectionModel}"
    var="row" contentDelivery="immediate" inlineStyle="height:300px;"
    binding="#{fileDownloadBean.faqTable}"
    rowSelection="single"
    rows="#{bindings.faqsTypeDocumentView1.rangeSize}"
    emptyText="#{bindings.faqsTypeDocumentView1.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.faqsTypeDocumentView1.rangeSize}"
    rowBandingInterval="0" id="t1">
    <af:column
    headerText="Document Name"
    id="c1">
    <af:commandLink text="#{row.DocName}" id="cl1" >
    <af:fileDownloadActionListener filename="#{row.DocName}"
    contentType="#{row.ContentType}"
    method="#{fileDownloadBean.downloadFaq}"/>
    </af:commandLink>
    </af:column>
    </af:table>
    </af:panelBox>
    public void downloadFaq(FacesContext context,
    OutputStream out) throws IOException {
    System.out.println(" file download clicked ................");
    oracle.adfinternal.view.faces.model.binding.FacesCtrlHierNodeBinding rwData = (oracle.adfinternal.view.faces.model.binding.FacesCtrlHierNodeBinding)faqTable.getSelectedRowData();
    Row row = rwData.getRow();
    System.out.println(" Doc Id : "+ row.getAttribute("DocId"));
    BlobDomain blob= (BlobDomain)row.getAttribute("Document");
    long size= blob.getLength();
    try{
    InputStream is = blob.getInputStream();
    byte[] buffer = new byte[(int)size];
    int nread;
    while ((nread = is.read(buffer)) != -1)
    out.write(buffer, 0, nread);
    }catch(IOException ioExp){
    context.addMessage(null, new FacesMessage(" Not able to download file."));
    ioExp.printStackTrace();
    }

    If I download the files from database then it do not allow me download same file more than one.. After Downloading the document If i click again to download then i get 0 size file...
    If i download the files from server relative path then it works fine...i was able to download same file more than one time..
    below is the error on console ....
    <JUApplicationDefImpl> <logDefaultDynamicPageMapPattern> The definition at fdny.pension.portal.eupsPortal.DataBindings.cpx, uses a pagemap pattern match that hides other cpx files.
    <SkinFactoryImpl> <getSkin> Cannot find a skin that matches family portal and version v1.1. We will use the skin portal.desktop.
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6
    java.lang.NullPointerException
         at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormRenderer.getAutoComplete(FormRenderer.java:1152)
         at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.FormRenderer.encodeBegin(FormRenderer.java:237)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeBegin(CoreRenderer.java:311)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeBegin(UIXComponentBase.java:734)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
    Thanks for helping me here..

  • How to play Windows AVI file using Teststand

    Hi,
    I'm trying to play a Windows AVI (*.avi) file using the Windows Media Player, launched by
    a Teststand CallExecutable type step.
    When the step executes, the Windows Media Player app. starts o.k., but the file to be played
    causes an error which states the file type is not recognised.
    Yet if the AVI file is selected in Windows Explorer, it runs fine, i.e. the file type is associated with
    Windows Media Player.
    If the 1st error is ignored, a 2nd is displayed. This states the file cannot be played, and suggests that
    the path may be incorrect or the server is unavailable.
    When configuring the Teststand CallExecutable step, the Argument Expression field contains the full
    absolute address of the AVI (*.avi) file to load and play.
    I have also tried using an expression and also placing the AVI file in the same directory as the
    Windows Media Player .exe, but the file will still not play.
    If I use the Run utility from the Windows Start menu, I can enter the same details on a single command
    line, and the AVI (*.avi) loads and plays just fine.
    What should I do to get Windows Media Player to run the AVI (*.avi) file using the Teststand CallExecutable step ?
    thanks,
    Gary.

    Gary -
    FYI, with TS 3.5, the MessagePopup step can also display html files. The html file can reference the player control and tell it to run immediately. The html code looks like this:
    <HTML>
    <HEAD>
    <TITLE>Multimedia Control Page</TITLE>
    </HEAD>
    <BODY LANGUAGE = VBScript>
    <p>
    My header text
    <p>
    <object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA​6" id="WindowsMediaPlayer1" width="300" height="200">
     <param name="URL" value="c:\windows\clock.avi">
     <param name="rate" value="1">
     <param name="balance" value="0">
     <param name="currentPosition" value="0">
     <param name="defaultFrame" value>
     <param name="playCount" value="1">
     <param name="autoStart" value="-1">
     <param name="currentMarker" value="0">
     <param name="invokeURLs" value="-1">
     <param name="baseURL" value>
     <param name="volume" value="50">
     <param name="mute" value="0">
     <param name="uiMode" value="full">
     <param name="stretchToFit" value="-1">
     <param name="windowlessVideo" value="0">
     <param name="enabled" value="-1">
     <param name="enableContextMenu" value="-1">
     <param name="fullScreen" value="0">
     <param name="SAMIStyle" value>
     <param name="SAMILang" value>
     <param name="SAMIFilename" value>
     <param name="captioningID" value>
     <param name="enableErrorDialogs" value="0">
    </object>
    </p>
    My footer text
    </BODY>
    </HTML>
    Scott Richardson
    National Instruments

  • About the popup window created by if_wd_window_manager- create_window

    hi,experts
    i want to put out a pdf file in popup window.and use method create_windos of if_wd_window_manager to get it.then i find a question: i at least click twice to close the window....why? what modification i need to implement that  the window close as soon as i click the "CLOSE" button once. i guess that is normal.
    the original codes is as follows:
      data: lr_view               type ref to if_wd_view_controller,
            lr_api_main           type ref to if_wd_component,
            lr_window_man         type ref to if_wd_window_manager,
            comp_usage            type ref to if_wd_component_usage,
            l_title                   type string value 'print the contract'.
            lr_window              type ref to if_wd_window.
      lr_view = wd_this->wd_get_api( ).
      lr_api_main = wd_comp_controller->wd_get_api( ).
      lr_window_man = lr_api_main->get_window_manager( ).
    l_title = wd_comp_controller->model->get_text( '006' ).
      call method lr_window_man->create_window
        exporting
          modal        = abap_true
          window_name  = 'POPUP'
          title        = l_title
          close_button = abap_on
         BUTTON_KIND  = '1'
         default_button = '5'
        receiving
          window       = lr_window.
      lr_window->open( ).
    thanks..looking forwards to your help!

    hi ,Sajid
    1.
    data l_api_v_new_assignment type ref to if_wd_view_controller.
      l_api_v_new_assignment = wd_this->wd_get_api( ).
      data window_controller type ref to if_wd_window_controller.
      window_controller = l_api_v_new_assignment->get_embedding_window_ctlr( ).
      data window type ref to if_wd_window.
      window = window_controller->get_window( ).
      window->close( ).
    to your first option.   my codes are written  in a view of the main windows and the popup window is another, so can't get the exact window.. so there is a dump error after i test this one.
    iF MO_POPUP TYPE REF TO IF_WD_WINDOW, IS AN ATRIBUTE DEFINED IN COMPONENT CONTROLLER
    and in popup_method this is the coding related for opening popup .
    DATA:lo_api TYPE REF TO if_wd_component,
    lo_win_manager TYPE REF TO if_wd_window_manager,
    lo_api = wd_this->wd_get_api( ).
    lo_win_manager = lo_api->get_window_manager( )
    wd_this->mo_popup = lo_win_manager->create_window(
    title = 'xyz'
    window_name = 'WINDOW NAME'
    button_kind = if_wd_window=>co_buttons_okcancel
    message_type = if_wd_window=>co_msg_type_warning ).
    wd_comp_controller->mo_popup->open( ).
    Then for closing pop up on event handler method of no write the following coding
    wd_comp_controller->mo_popup->close( ).
    to second one...  i think  this part of codes are the same as mine except the last sectence...... and i add the last sentence in my coding but nothing sepecial happend...
    looking forward for more helps...thanks a lot

  • Load PDF file using ADF 11g

    Hi There,
    I have a requirement of showing PDF file in popup window or in a frame . I am using the following code
    <af:commandButton text="#{node}" useWindow="true" action="dialog:showPDF"
    actionListener="#{ReportTemplateDesigner.downloadPDFReport}" windowHeight="300" windowWidth="400" />
    and in managed bean
    public String downloadPDFReport(ActionEvent actionEvent) throws FileNotFoundException, IOException {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    HttpServletResponse response =
    (HttpServletResponse)externalContext.getResponse();
    File file = new File("C:\\report.pdf");
    FileInputStream input = new FileInputStream(file);
    BufferedInputStream bInput = null;
    BufferedOutputStream output = null;
    try {
    bInput = new BufferedInputStream(input, DEFAULT_BUFFER_SIZE);
    response.reset();
    response.setContentType("application/pdf");
    response.setHeader("Content-disposition",
    "inline; filename=\"" + "ABC" + "\"");
    output =
    new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);
    System.out.println("inside download PDF report");
    byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
    int length;
    while ((length = input.read(buffer)) > 0) {
    output.write(buffer, 0, length);
    output.flush();
    } finally {
    close((Closeable)output);
    close((Closeable)bInput);
    facesContext.responseComplete();
    return "dialog:showPDF";
    I can see the pdf file is loaded into the same window . Could anyone tell me is there any way to load PDF file on the same page in a frame ?
    Thanks in advance,
    Ree

    Managed bean code :
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext =
    facesContext.getExternalContext();
    HttpServletRequest request =
    (HttpServletRequest)externalContext.getRequest();
    String originalUrl = (request.getRequestURL().toString());
    String find = "Report";
    String replace = "Report/" + pdfFileName; // path of pdf file .
    pdfUrl = replaceAllWords2(originalUrl, find, replace);
    System.out.println("PDF URL :" + pdfUrl);
    Jsf code
    <af:inlineFrame source="#{Report.pdfUrl}"
    inlineStyle="width:100%; height:100%;"></af:inlineFrame>
    Hope this help.
    Reena

Maybe you are looking for

  • Apple's Mini Displayport to Dual link DVI Adapter... What to do?

    So i'm doing a new setup with 6 monitors (Eyefinity 6), and i've got everything set up so far... Except for adapters. So i went and got 4 Of those Accel MDP to DVI SL adapters, in addition to the two passive that come with a card. Didn't work... So i

  • How to use INDEXFILE param in Import

    ok, this is my first time trying to use this option. Oracle9i. Here's what I am doing. I have in my Import .bat file: imp user1/user1@db2 FILE=D:\exp1230.dmp LOG=D:\IMP.log FROMUSER=USER1 TOUSER=USER1 BUFFER=100000 IGNORE=Y INDEXFILE=D:\indexfile.sql

  • SPWebConfigModifications Duplicate entries, applying to all Web Applications and not removing entries

    Hi, Hopefully someone can offer some advice, I may be missing something obvious here. I'm currently trying to write a feature event receiver to apply web.config modifications that are required by a recent project.  The feature is web application scop

  • SAPWL_STATREC_READ_FILE  Obsolete in ECC 6.0

    Hi All, We are working with upgrade from 4.5 b to ecc 6.0. SAPWL_STATREC_READ_FILE  TABLE_DECOMPRESS HELP_VALUES_GET_EXTEND Above Function modules are absolte.Please specift the corresponding funciton modules of ECC 6.0. Thanks in Advance Regards, Pa

  • Extractor for goods issue

    Can anyone send me the name of the extractor for goods issue? Does it comes under SD? or MM fullfillment?  Thanjs Raj