Update OneToMany collection from jsf page

Hello,
I have a problem updating a OneToMany relationship from a jsf page.
I get an parent object via the local interface from the ejb, then I remove a child from the onetomany relationship and call my save method on the stateless bean which just merges the parent object back to the entitymanager.
But the child I've removed gets not deleted from the database (so its in the collection again after refresh).
So whats the preferred way to do this?
thanks
Dirk

Thanks for the reply.
I have (actually had) two problems. The first one I've solved since my initial post (stupid error on my part).
The other unsolved problem is JSF pages displaying stale data. User navigates to first page, navigates to second page, at this point the database changes, and then the user navigates back to first page. Navigating back to the first page shows the data how it was, not how it is, because it's from the session bean and not the database. If I could kill the session bean when the user navigates from the page the problem would be solved because I build the inital display in the constructor (BTW, please advise if this is a bad approach).
Frank, your reply raised a question. Is there a way to specify a refresh frequency? If so, how?
Thanks,
Al Malin

Similar Messages

  • Calling a method in BPM Object from jsf page

    Hi All,
    How do I call a method in BPM object from JSF page? Is it possible to invoke it in a manner similar to invoking a method from managed bean in JSF application?
    Please help.
    Thanks and Regards,
    Veronica

    You can use f:invoke (or f:invokea to with parameters)
    For ajax calls, you can use f:invokeUrl to get the URL to a particular method within your BPM object, although make sure the Server-Side Method property is set to Yes.
    http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/taglib/index.html

  • An update of iMovie failed with the message "an error has occurred." That message remains posted by iMovie on the Mac App Purchases page. iMovie is now unavailable. It will not start, update, or reinstall from purchases page. How reinitialize app?

    An update of iMovie failed with the message "an error has occurred." That message remains posted by iMovie on the Mac App Purchases page. iMovie is now unavailable. It will not start, update, or reinstall from purchases page. How do I reinitialize the app?

    Thank you again. Here's the console messages from trying to open iMovie and then opening the App Store. Clicking on the iMovie icon in App Store purchases and clicking on check for unfinished downloads:
    8/28/14 4:56:26.743 PM Dock[214]: LSOpenFromURLSpec(file:///Applications/iMovie.app/) failed with -10699
    8/28/14 4:56:47.878 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:56:47.879 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:57:50.201 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:57:50.201 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:35.745 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:35.745 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:35.824 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:35.824 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:35.847 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:35.847 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:36.276 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:36.276 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:39.448 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:39.448 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:39.449 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:39.449 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:55.996 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:55.996 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.021 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.022 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.051 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.052 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.342 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.342 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.411 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.411 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.425 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.425 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.508 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.508 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.518 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.519 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.696 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.696 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.808 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.808 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.826 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.827 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.838 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.839 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.843 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.843 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.857 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.857 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.893 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.894 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.907 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.907 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.923 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.924 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:56.969 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:56.970 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:57.039 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:57.039 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:57.045 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:57.045 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:57.145 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:57.145 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:57.231 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:57.231 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:57.249 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:57.249 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:57.293 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:57.293 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:57.350 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:57.350 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:57.352 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:57.353 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:57.400 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:57.400 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:57.402 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:57.402 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:59.814 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:59.814 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:58:59.932 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:58:59.932 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:00.697 PM acwebsecagent[127]: Connection : Failed to connect to 167.8.226.9:80. Code : 60
    8/28/14 4:59:00.698 PM acwebsecagent[127]: Connection : Caught exception. Code : 60
    8/28/14 4:59:00.698 PM acwebsecagent[127]: Connection : Failed to connect externally. Code : 60
    8/28/14 4:59:01.352 PM acwebsecagent[127]: Connection : Failed to connect to 167.8.226.9:80. Code : 60
    8/28/14 4:59:01.352 PM acwebsecagent[127]: Connection : Caught exception. Code : 60
    8/28/14 4:59:01.352 PM acwebsecagent[127]: Connection : Failed to connect externally. Code : 60
    8/28/14 4:59:01.402 PM acwebsecagent[127]: Connection : Failed to connect to 167.8.226.9:80. Code : 60
    8/28/14 4:59:01.402 PM acwebsecagent[127]: Connection : Caught exception. Code : 60
    8/28/14 4:59:01.402 PM acwebsecagent[127]: Connection : Failed to connect externally. Code : 60
    8/28/14 4:59:26.564 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:26.565 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:26.660 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:26.660 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:26.840 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:26.840 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:26.864 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:26.864 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:26.984 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:26.984 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:27.069 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:27.069 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:27.079 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:27.079 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:27.083 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:27.084 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:27.385 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:27.385 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:27.389 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:27.390 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:27.391 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:27.391 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:27.411 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:27.411 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:27.435 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:27.436 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:27.443 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:27.443 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:27.479 PM acwebsecagent[127]: Connection : Auth key is not provided or is invalid, applying connection failure policy. CMode : 2 TMode : 1
    8/28/14 4:59:27.479 PM acwebsecagent[127]: OnConnectionFailure : Fail Open - Reason = Unable to verify the license key
    8/28/14 4:59:31.036 PM acwebsecagent[127]: License : One or more of the License/Public Key can't be NULL
    8/28/14 4:59:31.036 PM acwebsecagent[127]: SSLExt : Failed to get ScanSafe headers
    8/28/14 4:59:31.036 PM acwebsecagent[127]: DownloadUpdatedConfig : Failed to download updated config. Host hostedconfig.scansafe.net. Code 0x80004005

  • Can i call signed applet from jsf page in sun studio creator

    Hello javites,
    I want to know whether i can call signed applet from jsf page in sun studio creator. If possible, how do i go about it.
    Thanks.

    This tutorial may help:
    http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/applet.html?feed=DSC

  • Using workflow from jsf pages...

    We have built a simple JSF page on OC4J app server..
    We want to call our workflow program from this page.
    How should I use the CREATE PROCESS() AND START PROCESS() inside the JSF page?
    We are using 10.1.2. application server. And We SSO connection between
    OC4J 10 1. 3.2
    we deploy our java application to this OC4J..
    But we when we call workflow functions we get get_remote_user error.
    Can we call direct PL/SQL API over JDBC connection without using OWF Java API.
    Or we need (must) use Java aPI to supply this.
    Thanks...

    We see that we can call CREATE PROCESS() OR START PROCESS() inside the JSF page..
    But the problem are about notifications which needs authentication now
    How can we use notifications from java...
    Can we call direct PL/SQL API over JDBC connection without using OWF Java API.
    Or we need (must) use Java aPI to supply this.
    Thanks...

  • Calling a method in the Custom ADF component from JSF page

    HI.
    I have created some custom compoents by extending the core ADF Components. Like i have a ComboBoxDefault component with it's ComboBoxDefaultTag.java and Controls.tld file.
    Now my requirement is i want to bind my label to this component from the JSF page. like
    <fwcontrols:label binding="#{listComponents.comboBoxDefaultLabel}" id="label1"/>
    <fwcontrols:comboBoxDefault binding="#{listComponents.cmbLocales}"
    value="en_GB" id="comboBoxDefault" autoSubmit="true" label="label1">
    <f:selectItems value="#{listComponents.locales}"/>
    </fwcontrols:comboBoxDefault>
    In my JSF page the label will have an id, and that id will be specified in the label tag of the component.
    In Tag.java file i have overrided the setProperty(FacesBean facesBean). In this method i have bind all my properties. In core JSF the setProperty method is provided with the UIComponent parameter, so i can call my method in component also. Which is not in case of ADF Faces.
    My main point is how i can call my method setLabel() which is in ComboBoxDefault.java so that i can set the label.
    Thanks in Advance.

    Thanks for all your replies. I want this kind of a functionality because Im trying to invove a DC (Child DC) from a Parent DC such that the Child DC's view is displayed onto the view container of the Parent DC. I have embedded using 'interface view of a component instance' in the Parent Window and am able to create the component and set usage though the onPlugDefault of the Child View.
    But I observe that when i make a call from the parent, the flow is like this:
    1. The wdDoInit of the Child Component Controller gets triggered first.
    2. Then the wdDoInit of the Child's <b>VIEW</b> gets triggered
    3. and <b>THEN</b> the onPlugDefault of the Child Component Interface View
    What I had actually wanted was to Fire onPlugDefault where Im calling a method LoadData(), after which the Child DC's view must be triggered so it can display the fetched data.
    What is actually happening is the view gets displayed, but no data is displayed in the view.
    Right now I have just given a work around where Im triggering <b>LoadData()</b> of the <b>COmponent COntroller</b> from the <b>wdDoInit</b> of the <b>VIEW</b>.
    Is there a better way to do this? I find it strange that I have to load the Data from the view.
    Thanks
    Jack

  • Capture generated html output from jsf page in bean

    Hi Member,
    I have need to capture the html output coming form jsf page. means aftr rendering what html is displayed before user, we have need to get it in programm.
    like if we use:
    <h:dataTable......>
    <h:colum>heloo</h:column>
    </h:dataTable>
    then their ouput will be:
    <table>
    <tr><td>heloo</td></tr>
    </table>
    and i have need of these complete line with <table> ......</table>
    Please help me...
    Thanks
    Shailendra Kumar

    Thnx for quick reply.
    But i want to capture it in render response phase. May it will be possible??? Is render response phase is responsible for generation of HTML format?? If yes then how can we capture output coming from this phase.
    URLConnection if fine but it still hit server once. I don't want that. I want to store page html format during its view preparation for html.
    Thanks
    Shailendra Kumar

  • Problem with opening PDF files from JSF page using SDO

    Hi all,
    I'm new with JSF and was attempting to read a PDF file from a Database using SDO and JSF. The code below throws an exception when casting from DataObject to Blob. The getLcDoc() method was created by WSAD when I dragged an SDO relational record onto the JSF page. This method returns an DataObject type which I tried casting to a Blob type before using it further. However, an exception is thrown.
    Any feedback is appreciated.
    Arv
    try {
                   FacesContext faces = FacesContext.getCurrentInstance();
                   HttpServletResponse response =(HttpServletResponse) faces.getExternalContext().getResponse();
                   Blob file= (Blob)getLcDoc().get("ATTACH");
                   int iLength = (int)(file.length());
                   response.setHeader("Content-type", "application/pdf");
                   response.setHeader("Content-Disposition", "inline; filename=Attachment");
                   response.setHeader("Expires","0");
                   response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
                   response.setHeader("Pragma","public");
                   response.setContentLength(iLength);
                   ServletOutputStream os = response.getOutputStream();
                   InputStream in = null;
                   in = file.getBinaryStream();
                   byte buff[] = new byte[1024];
                   while (true) {
                   int i = in.read(buff);
                   if (i<0) break;
                   os.write(buff,0,i);
                   os.flush();
                   os.close();
         } catch(Exception ex){
              System.out.println("Error while reading file : " + ex.getMessage());
         }

    Hi...I found out that there is actually no need to use a Blob object at all. You can simply call the OutputStreams write() method and pass the DataObject.getBytes() method that returns a byte[] array. The revised code is shown at the end of this posting.
    However, a few other teething problems exist:
    1. This works well only if I specify the content type in response.setHeader() method. What if my users upload different types of files, is there a way that the browser opens according to the file type without setting the content type?
    2. I still have a problem opening PDF files, even if I specify - response.setHeader("Content-type", "application/pdf");
    I get the message - The file is damaged and could not be repaired
    3. I would also like this to open the attachment in a new window and using target="_blank" doesn't seem to work as seen below:
    <h:commandLink
                                                 styleClass="commandLink" id="link1" action="#{pc_DocumentDetailsRead.doLink1Action}" target="_blank">
                                                 <h:outputText id="text5" styleClass="outputText"
                                                      value="Click Here"></h:outputText>
                                            </h:commandLink>
    ------------------------Revised code-----------------------------------------
    FacesContext faces = FacesContext.getCurrentInstance();
                   HttpServletResponse response =(HttpServletResponse) faces.getExternalContext().getResponse();
                   response.setHeader("Content-type", "application/msword");
                   response.setHeader("Content-Disposition", "inline; filename=Attachment");
                   response.setHeader("Expires","0");
                   response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
                   response.setHeader("Pragma","public");
                   ServletOutputStream os = response.getOutputStream();
                   os.write(getLcDoc().getBytes("ATTACH"));
                   os.flush();
                   os.close();

  • Creating a pdf file of datatable from Jsf page

    Hi ,
    I want to prepare a pdf file of a data table and store at some system loaction from a Jsf page. How can this be acheived? Any example would be a great help.
    Thanks,

    hi here this adress http://displaytag.homeip.net/displaytag-examples-1.1/example-export.jsp with display tag you can export import your datatable to excel or pdf format.

  • Missing stylesheet classes from JSF page

    I'm not sure this is JHeadstart related and I will post on the JDeveloper forum as well but since all our applications are built using JHeadstart I thought I would post this hear in case other people had seen similar behaviour.
    We're using JDeveloper 10.1.3.4 and JHeadstart 10.1.3.3.81, developing JSF pages.
    Ocassionally when a page loads, the stylesheet classes are missing - I presume, as all the graphic rendering is not done, only text is shown on the screen - which then means that most of the user interaction is gone ! This is an intermittent problem. I was wondering if this is related to caching of page content at all and whether there is anything that can be done to help avoid the problem.
    Any feedback greatly appreciated !
    Cheers,
    Brent

    Hi Steven,
    This managed to resolve itself by undeploying the application, bouncing the server and redploying. It's happened more than once but it's not giving us too much grief ! We also noticed that if the application is viewed on IE8, a generic oracle-desktop ie css file is used (rather than the more specific oracle-desktop-ie7 one) which causes some delays when loading parts of the page.
    Cheers,
    Brent

  • Why have the tweet and status update boxes disappeared from notification page a werk after updating to iOS 6v

    When i updated to iOS 6 last week i had the tweet and facebook status update boxes on my notification page and have been using them daily but today they have both disappeared and i don't know how to get them back.

    Your issue has already been addressed ad nauseum.  Please search this forum and/or look in the "More Like This" box to your right.

  • Controlling page setup properties from JSF page

    Hi there :)
    How to control print properties like size,margins on left,right,top,bottom,header,footer etc in page setup through jsf page?
    Thanks in advance.
    Cheers.

    Not.

  • Processing a request from JSF page?

    Hello all,
    I made a small page in JSF to display a form. I want to process the data in an EJB. When I press the submit button, a particular method is called. How should I pass the form data to EJB - I mean in what format,
    should I pass various arguments to a method of bean? That doesn't sound like good practice. What if I have many fields in form?
    should I pass the arguments as a List array of Strings?
    or is there some better method?

    Hi Vikram,
    To understand i am giving small exaple to you which helps u to get the formdata in the managed bean method.
    Below is the sample code, we have a input text and the value is binded to Register that is a managed bean which u need to register in faces-config.xml file.
    When you clicks the commandButton below the action will be submitted and the method process will invoke in the managed bean (Register). In this method you will get the inputText value which you entered.See the below code how to get the value.
    <h:inputText id="text1" value="#{Register.text1}" styleClass="inputText" />
    <h:commandButton id="bLogin" value="Login" action="#{Register.process}"/>
    public class Register extends PageCodeBase{
    private String text1=""; //created one string for the textBox id=text1 and provide setters & getters
    public String getText1() {
              return text1;
         public void setText1(String text1) {
              this.text1 = text1;
    public String process(){
    System.out.println("IN PROCESS METHOD");
    //In the below line you will get the value entered in the text box.
    System.out.println("Getting the value of input text box:::"+getText1());
    Here you can perform what ever business login u need.
    return "back";
    Feel free to ask any questions.
    Thank You,
    Subrahmanyam Baratam.

  • Problem opening popup from jsf page....

    Hi to all....i have a problem, i'm trying to open a popup window using "outputLink".
    My code is:
    <h:outputLink value="#" onclick="window.open('#{appManager.basePath}/admin/selectCollection.jsf','','width=600, height=400, resizable=yes, fullscreen=no, menubar=no, toolbar=no, status=no, scrollbars=no, location=no')">
         <h:outputText value="#{bundle.selCollection}"> </h:outputText>
    </h:outputLink>
    The "window.open" works perfectly, but the parent window shows the page "Directory Listing For /" with the list of directories of my root project...
    What is the problem?

    try to use the popupFrame component of jenia4faces library (http://www.jenia.org).
    Is a good solution for popups problem

  • Update multiple records from a list

    Just trying to find some tutorials on how to update multiple
    records from 1
    page of checkboxes
    easiest example is hotmail
    i would like to be able to give my clients the ability to
    delete or update
    multiple records from 1 page... mind you that this type of
    update woudl only
    be for simple status changes, flags that need to be changed
    and so on...
    Delete... well if they made it to this page they are already
    sure and have
    been warned that they are going to delete the records..
    where can i find such a tutorial on how to complete multiple
    record updates
    or deletes from 1 form...
    thanks

    Server model and software below.
    And hotmail has nothing to do with anything.. its an example
    of what i would
    like to be able to do...
    If you log into hotmail. you have the option to check all the
    emails you
    want to delete.
    well thats what i want to do with my clients sites...
    Each record would have its own checkbox, they select the
    records they want
    to delete or update and they hit submit to process there
    request.
    Using ASP, SQL2005 and DW8
    "bregent" <[email protected]> wrote in
    message
    news:f21upb$nop$[email protected]..
    > >Just trying to find some tutorials on how to update
    multiple records from
    > >1
    >>page of checkboxes
    >
    > What server model?
    >
    >>easiest example is hotmail
    >
    > What does hotmail have to do with this.

Maybe you are looking for

  • Unable to create sub site after setting up site subscription in Sharepoint Foundation 2013

    Hi, All, I have set up sit subscription in to the sharepoint. I have a Site collection which is assign to specific tenant group. I have assign sevral custom features to the tenant group. What happening now is, when I am creating a sub site, it throws

  • Cannot install apps on my bb

    I cannot install several apps on my bb 9360 (Vodafone Ro) - qik, shazam, eagleeye, etc. For all of these i get the error message The Item is not available for your Device Model, Device OS, Carrier and Country combination. Pls advise.

  • Is there a simple way to merge mp3 files into one mp3 file:

    Is there a way to simply merge multiple mp3s into one? I have audacity; however, that program becomes cumbersome when merging multiple files. My thanks to anyone for help on this one.

  • Need Appointment Function Module Name to Read any Opportunity  No.

    Hello Gurus Can anyone  tell me the Appointment  type Function Module Name where Header_guid and  Appt_type are to be supplied . Means i want to only read(not to change or create)  an opportunity no for a particular Appointment type(Date_type).  I tr

  • Urgent: Problem in Fetching the records from ITAB3

    hi, here's d code,and the bold is dere where i am facing the problem i.e. whne i append lines of ITAB2 to ITAB3 it takes 32,234 records but in reality in ITAB2 there are 39 records,ITFINAL contains 45 records which is displaying the coreect data. But