ADF - Executing Code on Page Load  running on Weblogic 10.0

Has anybody also try the on page load example at
http://groundside.com/blog/DuncanMills.php?blog=6&c=1&page=1&more=1&title=adf_executing_code_on_page_load&tb=1&pb=1&disp=single
this example run ok in jdeveloper but failed on weblogic 10, this should be a deployment isue.
any ideas?

I got following error message, seem like this issue is related to the AdfFacesContext object releasing :
WARNING: AdfFacesContext had not been properly released on earlier request.
java.lang.NullPointerException
at oracle.adfinternal.view.faces.renderkit.core.CoreAdfRenderingContext.<init>()V(Unknown Source)
at oracle.adfinternal.view.faces.renderkit.core.CoreRenderKit.encodeBegin(CoreRenderKit.java:329)
at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:149)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.phase(Ljavax.faces.event.PhaseId;Lcom.sun.faces.lifecycle.Phase;Ljavax.faces.context.FacesContext;)V(Unknown Source)
at com.sun.faces.lifecycle.LifecycleImpl.render(Ljavax.faces.context.FacesContext;)V(Unknown Source)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:123)
at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
I have two filter defined in web.xml, is that correct order?
<filter>
<filter-name>adfFaces</filter-name>
<filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
</filter>
<filter>
<filter-name>adfBindings</filter-name>
<filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
</filter>

Similar Messages

  • Howto execute code on page load

    I am writing a small web app that displays a table with the contents of a directory on my server. The page includes links to my page plus a parameter indicating the path of the directory or file to show (e.g. page1.jsp?C:\Dir1). This part is dynamic.
    The output will be in a table as follows:
    <table>
         <tr>
              <td>Dir</td><td><a href="page1.jsp?C:\Dir1"/>Dir1</a></td>
          </tr>
          etc........Where can I include the code to generate this page? I have included the code in the constructor and it works only for the first time. The problem is that once the browser forwards to the page, the page returns blank from second time onwards.
    Thanks and Regards
    Joseph.

    Hi
    I am not sure if I understand what you are trying to achieve. I assume you are trying to build an HTML table with some links and you want to display this HTML table on your Page1.jsp.
    This can be achieved by setting the String value to an outputtext component with escape property turned off. Drag an outputText on to the Page and turn off the escape property for it. Now use your logic to build a String dynamically with the code for the HTML table. Some thing like
    String strHtml = "<table> <tr> <td>Dir</td><td><a href=\'page1.jsp?C:\Dir1\'/>Dir1</a></td> </tr></table>"Now set this value to an outputtext component using outputtext1.setValue(strHtml);
    Now you will see the outputtext displays the HTML table.
    If you are trying to do something else plese let us know in detail. A sample project would help us to understand the issue in detail. Please send your sample to guda AT sun DOT com
    Thanks
    Creator Team

  • How to initialize an adf component before a page loads

    Hi all
    I use JDeveloper 11.1.2.2.0
    I have two pages:
    first page has a link to a second page
    <af:document title="first.jspx" id="d1">
      <af:form id="f1">
        <af:commandLink text="Page 2" id="cl1" action="goToSecondPage" actionListener="#{Bean.handleLinkActionEvent}"/>
      </af:form>
    </af:document>and the second page has an inputText component:
    <af:document title="second.jspx" id="d1">
      <af:form id="f1">
        <af:inputText label="Text" id="it1" binding="#{Bean.inputText}" readOnly="true"/>
      </af:form>
    </af:document>First I load first.jspx and than I click the link. This event is handled in handleLinkActionEvent() method, in which I want to set a value to the inputText component of the second page. But I can't do it, because as expected I get NullPointerException.
    So the question is how to initialize an adf component before a page loads?
    Evgeny Michuk
    Edited by: Evgeny Michuk on Oct 4, 2012 11:30 PM

    Thanks a lot for your replies and links, it gives me some new knowledges.
    I got your approach and achieved the aim for the described situation with tag <f:setPropertyActionListener>:
    <af:commandLink text="Page 2" id="cl1" action="goToSecondPage"
                           actionListener="#{Bean.handleLinkActionEvent}" binding="#{Bean.firstPageLink}">
      <f:setPropertyActionListener target="#{pageFlowScope.text}" value="Hello, World!"/>
    </af:commandLink>and for the inputText component I set the value:
    <af:inputText label="Text" id="it1"  binding="#{Bean.inputText}"
                                  readOnly="true" value="#{pageFlowScope.text}"/>I used request scoped managed bean and it is shared for both pages.
    I understand that I can set a value of some attribute for managed bean
    and use it to set a value for inputText component of the second page,
    but as I understand it is almost the same way as usage of tag <f:setPropertyActionListener>.
    In my real situation on the second page I have a dynamic table, and it's field is read only.
    Structure of this table depends on a link clicked on the first page.
    So I define components for table columns in runtime, it may be outputText, inputDate, goLink and some others.
    And I have to get table through the UIComponent binding to set columns.
    Certainly I can define all needed components for all columns
    and render it according to the column types
    <af:table value="#{Bean.collectionModel}" var="row" id="t1" binding="#{Bean.mainTable}">
       <af:forEach items="#{Bean.columnDescriptionList}" var="column">
          <af:column headerText="#{column.caption}" id="c1">
             <af:outputText value="#{row[column.fieldName]}" id="ot1" rendered="#{column.type == '1'}"/>
             <af:inputDate value="#{row[column.fieldName]}" id="ot2" rendered="#{column.type == '2'}"/>
             <af:selectBooleanCheckbox id="sbc1" selected="#{row[column.fieldName] == '1'}" rendered="#{column.type == 'n'}"/>
          </af:column>
       </af:forEach>
    </af:table>but I think it is not very good.
    Have you any idea?
    P.S. I hope I clearly explained my situation =)
    Evgeny Michuk

  • Oracle ADF refresh as deferred does not execute query on page load

    In the oracle ADF page I have two panel boxes. (Oracle ADF 11.1.1.4)
    a) Personal information panel box with PanelFormLayout (PersonalInfoViewObj) - ReadOnly View Object
    b) Address information panel box with Table (AddressInfoViewObj) - Read Only View Object
    For the iterators in a) and b) I have kept refresh condition as deferred and cacheResult=false. Also in b) for af:table, I have kept contentDelivery="immediate"
    When page loads it fires SQL query for a) and populate the data in Personal information panel box. However for b) it does not execute the SQL query and the data is not getting populated ( in AddressInformation panel with the tables. Please note data is there in the DATABASE......)
    Becasue with the refresh as deferred it was not executing the sql query for Panel b) (panel with Table and table iterator). I have tried refresh as always and refresh ifNeeded/renderModel/prepareModel however in that case it is executing the SQL query two times (twice).
    Please let me know the best way to fix this issue.

    Hi,
    I think you need a method in an application module to init your data.
    In your AM : create a method like :
    public void init(){
    getViewObject().executeQuery();
    }In your adfc-config.xml create a methodCall from this method and a "control flow case" from the methodCall to your page.
    and keep refresh as "deferred " in your pageDef.
    Clément

  • Execute javascript on page loading?

    i want a javascript function to execute on page loading. it should set the local user name ( from system.properties) in an inputtext.
    how can i do this?

    You can't. It would be a huge security hole otherwise.
    In a certain web browser developed by some team in Redmond you can use ActiveX, but that thing would by default popup a security dialogue asking the user for permission to get it.
    Forget about it. Rather consider an application which runs at the client machine, e.g. a signed Applet or Web Start Application.

  • Execute javascript on page load

    All,
    I have a javascript working well on click button via javascript:html_Submit_Progress(this) but now i want to use the same code to execute onload page can somebody help me with the necessary change on this code please to make it work whenever the page loads,
    function html_Submit_Progress(pThis){ 
         $x_Show('AjaxLoading');
         window.setTimeout('$s("AjaxLoading",$x("AjaxLoading").innerHTML)', 100);
         doSubmit('APPLY_CHANGES');
         function submit_HideAll(pThis){ 
         $x_Hide('wwvFlowForm');
         doSubmit('APPLY_CHANGES');
         function submit_ButtonRegion(pThis){ 
         $x_Hide('button_region');
         doSubmit('APPLY_CHANGES');
    ..appreciated in advance.

    So I assume your code in PageLoad looks something like this?
    $x_Show('AjaxLoading');
    window.setTimeout('$s("AjaxLoading",$x("AjaxLoading").innerHTML)', 100);
    doSubmit('APPLY_CHANGES');Don't put the doSubmit call in page load. That will cause a submit, then the page loads again, submits again as a result of being called on page load, etc. and that's why you're looping over and over...every time the page loads you're submitting again.
    I would instead do this.
    1. Make a function somewhere on your page wherever appropriate:
    function html_Progress(pSubmit){
    $x_Show('AjaxLoading');
    window.setTimeout('$s("AjaxLoading",$x("AjaxLoading").innerHTML)', 100);
    if(pSubmit)
      apex.submit(pSubmit); //doSubmit is "old"...apex.submit is the new Apex 4 way of submitting
    } 2. In page load DA do this:
    html_Progress();
    3. Anywhere else you need it called and submitted too:
    html_Progress('APPLY_CHANGES');
    In other words, if the caller doesn't pass anything for pSubmit, don't submit. (This would be in a page load context.)
    If the caller does pass something for pSubmit, then submit. (This is likely to be pressing the Apply Changes button or whatever else.)
    Edited by: gti_matt on Sep 26, 2012 1:31 PM

  • Make an AM function execute only during page load time

    I have a function in the AM. I want to have it executed only during loading of the page. How can I achieve it.
    Message was edited by:
    mailsubhra

    Thanks a lot for the link.
    But my case is slightly different. I have a VO where I bind some variables. I run the first page and get some data. I am sending the fetched data from the first page to the second page using pageFlowScope.
    In the second page, I am binding a fucntion which will set the bind variables with some values (the values are the ones which are fetched from the first page using pageFlowScope). The VO is dropped as a table in the second page.
    So, to summarize, the situation is as follows:
    There is a VO which is dropped as a table in page2.jspx This VO has some bind variables. There is also an AM function which is bound to the page2.jspx and this function will set the bind variables using setNamedWhereClauseParam(...). The arguments to this function are passed from the pageFlowScope.
    Now there is a page1.jspx where I am able to select something and push the selected values to pageFlowScope.
    As I navigate from page1.jspx to page2.jspx, I want the VO in page2 to refresh according to the values chosen in page1. Hence I want the function to execute only when the page2 is loaded. If the function is not called during the rendering of page2.jspx, then the table becomes empty because the bind parameters in that VO are automatically set to null.

  • Table executes query on page load

    I have a popup in my page and a table in my popup...
    I use this popup for searching among records. When I render my popup, table comes with the sql suery results (invokes in popup load)...
    But I don't want the table come with the query results on load...I want table to list sql query results when I execute the search query.
    I want ; On load table as es empty,then When I execute, list query results.
    How Can I do this?
    Here is My sql query:
    SELECT KODU,ADI FROM TCARI WHERE UPPER(KODU) LIKE UPPER(:pk || '%') AND
    UPPER(ADI) LIKE UPPER(:pab || '%') AND UPPER(ADI) LIKE UPPER('%' || :pai || '%')
    Regards, islam

    Hi,
    option 1: Set the default value of the bind variable so that the query returns no result
    option 2: before launching the dialog (e.g. in a actionListener) set the underlying VO into find mode
    Frank

  • Create Simple Form Execute Query on Page Load

    Hi Everyone.
    I have a simple question.
    I created a simple form using the wizard based on a table.
    The result - 2 pages - One with a report and one linked page for maintaining data in the table (click on edit icon on page1 and page 2 loads executing a query).
    My question is this: Where on Page2 can I find the variable that Page1 populated?
    Meaning, when page2 loads, it executes a query and uses a variable that was populated on page 1.
    I checked under processes, but cannot see the query. Also checked Region and even default value for the primary key.
    This is important to me, because I might want to create a simple form that executes a query retrieving all data from the table without a where clause.
    Sorry - New to this tool and environment.
    Any suggestions would be appreciated.
    Regards
    Barend

    Barend - Check the Automated Row Fetch process on the form page. The report link will pass the primary key value into an item on that page and the process will use the value of that item to fetch the row for the form. You don't see the actual query because it's all declarative, i.e., you "declared" that you want a form populated from a table. We know the item name containing the PK value for the query and we know which items to populate on the form page.
    Scott

  • Mods Help Please ! "Code 0" Page Load Error

    Have no on demand services working at all now, have restarted the box and on demand works for about 1 min into programme and then freezes and box either restarts or shows this message Code 0 TV2RescourceLoadException:Failed to load resourse
    WebException:The remote name could not be resolved
    SocketException:No such host known.
    It is NOT a speed issue line speed sitting at 38megs as I type this.
    From system info :
    Pace DiT7421_05_L4/297
    Client version :2.0.26479.1941(RELEASE)
    BOOTSTRAP : 1.1527
    Everything was working perfectly until the "BBC Replay" option turned into BBC iPlayer yesterday evening.

    SRB wrote:
    Restarted box again, sat down to watch Lead Balloon and em, the box froze retarted again, threw up a little picture of cogs, sat for 15 mins with a bar slowly moving and then picture turned to a red cross with two dots underneath. I guess it really is dead this time. Guess it's the dreaded "help line". I may be some time.......
    No. it's not. The helpline won't have a clue.
    And sorry to tell you this, your box is fluffed. A dead parrot. Never to be ressurected again.
    You need to email the Mods, so they can get Tech to call you and arrange an appt, for a new black box.
     contact us form with a link back to this thread.
    Heres a previous thread...
    http://community.bt.com/t5/BT-Vision/Silver-Box-Model-DiT7421-05-L4-297-iPlayer-Update-Warning/td-p/...
    Explaining everthing.
    Hope you get it sorted soon.
    Rank - Mostly Harmless.

  • BT Vision "Code 0: Page Load Error"

    Hey people - my first post! Shame it's not on better circumstances.
    Upgraded to the Infinity 2 package yesterday (previously on BT's standard connection and recieving about 5mb/s) but it's not issues with that. The line will be bedded in by the end of the week I imagine and I'm recieving about 40mb/s download and 15 upload. Was promised 50 mb/s down and 25 up but I don't have too high a hopes for that. ANYWAY. To the matter at hand...
    Since setting the broadband up, my BT Vision is going haywire with the above error code. No On-Demand services are available to me at the minute but regular freeview is fine. The actual hub is closer than it was before and I've got some Belkin powerline adapters and although they're not regarded as a good solution to dead spots in the house; they work for me. I have been using the Belkin adapters since the previous connection as they seemed to hold a more stable connection than the white 'Simple Networking' ones that BT has provided me with.
    So far I've tried resetting the hub (including power cycling it), trying the white powerline adapters and soft-resetting (and hard-resetting) the vision box but to no avail. The On-Demand services will work but only for a short time before the picture (etc) goes jittery then cuts out altogether, leaving me with this error message.
    I have the Black version of the box, S/N: 1003 069 558.
    Let me know if you guys/girls need any more info!

    tomtomtom1230 wrote:
    Thanks! Forgive me but what's the EPG?
    The TV guide
    I will try but the Box is quite a way from the Hub. It'll be quite a chore to do.
    Can you borrow a long Ethernet cable, being careful not to create a trip hazzard?
    I suspected that they may have forgotten to carry the BTV service over.
    That could be a reason, but you should get error messages when booting up the old vision service, unless you're on the new look service...
    I'll see if I can manouver the Vision box close enough to the hub to connect directly before I give the dreaded Customer Services number a try!
    Oh the joy of the call centre!
    I assume since BT are aware of the PQ issue, they will be addressing it somehow in later updates, whether that's with the firmware or the hardware itself.
    Wellllll, some of it may be down to our own set up, but some of it may be with the service. I for one have seen a degraded PQ, but I'm on the new look service.
    Thanks for your help, I'll report back tomorrow morning at some point with my findings if the Box - Hub direct connection works.
    No problem and please do
    btw, sorry for the late reply, been dealing with a blocked drain
    -+-No longer a forum member-+-

  • Jsp page automatically running my javascript code

    I have some javascript functions in my jsp that I don't want to run until some kind of action occurs like an onclick event or a button push, but when the page loads it is executing the function. Is there any way to stop this?

    Normally a Javascript is processed as it is read by the browser, anything that appears inside of a function will not be processed unless that function is called in the normal reading sequence. It is generally a good practice to keep your callable functions inside of the <head> </head> tags. If you believed that your function got executed when the page loads, check the <body> tag to see if it includes an onLoad event-handler that might have triggered the execution or else the function may have been unintentionally called.
    The following HTML file demonstrates:
    1) How a JavaScript function is called by the browser in the process of rendering the page,
    2) How you can trigger a call to a JavaScript function as soon as the page is loaded (via a body onLoad), and
    3) How a JavaScript function can be called after the page has been rendered (via a hyperlink)
    <html>
    <head>
    <script>
    var zzz="disp function is called from a hyperlink";
    function disp(text) {
       alert(text);
    </script>
    </head>
    <body onLoad="disp('disp function is called after the document has been loaded')">
    Click me
    <script>
    alert("disp function is called in the course of reading the HTML");
    </script>
    </.body>
    </html>V.V.

  • How to Set icon/image programatically in ADF before page loads

    This is my UI:
    Depends on the condition i want to set icon/image programatically in my java code.Before page load im calling this method.
    So i couldnt take binding value also,it throws null pointer exception.Then i tried setting icon/image programatically.
    <af:commandImageLink text="settings" icon="#{bean.iconsettings}" binding="#{bean.bind}"> </af:commandImageLink>
    My bean:
    private RichIcon iconsettings;(its getters and setters)
    private void method(){                         // method
    if(cond){
    this.iconsettings="/images/20.jpg";   //trying to set icon in a string.but it throws me error that cannot set RichIcon to string.
    else
    this.iconsettings="/images/19.jpg";
    Could any one tell me how can i set icon/image in java code.Before page loads im performing all above said tasks.Please help.

    Well, you set the icon property to a bean method, which you have done. The bean method however need to have the signature
    public String getIconsetting()
    // your code returning hte path to the icon
    if(cond){
         return ="/images/20.jpg";   //trying to set icon in a string.but it throws me error that cannot set RichIcon to string.
    else {
         return ="/images/19.jpg";
    The bindproperty is not needed, remove it and remove the RichIcon Iconsettings too´as it's not needed to and is the wrong type anyway.
    Timo

  • Very simple question: Call JavaBean method on page load?

    Someone clicks on a URL that contains parameters like: http://server/page.jsf?param=b
    How do I trigger a JavaBean method to run during page load? I see many JSF examples where JavaBean methods get called during form clicks and that works great but here I want to run code on page load.
    This must be really simple; sorry I'm new to this technology.
    Must I use <% ... %> syntax or can I use actual JSF tags or configuration to accomplish this?
    Thanks very much in advance!

    Putting a lot of logic in getter( ) function is not the best idea considering that getter( ) could be called all over the place. Using constructor for same purpose is also a bad idea especially with request scope beans. This could also happen many times at different stages. You are right, having a page load concept could be useful. Unfortunately JSF framework does not support. You could architect around it in case desperate. Or if using JSF implementation of certain vendors like IBM, you can take advantage of their implementation that was extended to support pageLoad and postBack events (similar to .NET).
    Many postings on this forum dealt with topic. Feel free to review like this one:
    http://forum.java.sun.com/thread.jspa?forumID=427&threadID=541382

  • After click or page load...

    Hi,
    How to change the colour of the button using javascript code on page load and also clicking the button?
    skud.

    Any help?

Maybe you are looking for

  • Connect to Wireless Network - No Internet

    I have a Linksys WRT54GS using the lastest firmware. My desktop is hardwired to the router and can access the web. Linksys EasyLink Advisor shows shows my Cable Modem, the Wireless Router, the desktop and the laptop. I can connect to the wireless net

  • Airport extrem working with expresses to create a powerful network, but how

    I have one extreme base station and 3 expresses in a 3 story house with a basement. My network base is on the 3rd floor and I want the base station to link from that one to others to boost the signal. I thought I had it all set but am not getting goo

  • Scroll text to bottom

    I have imported text into a dynamic text field with a scroll bar. How would I go about starting the imported text at the bottom rather than having to scroll to the bottom? Normal: ----------------- window top text 1 text 2 text 3 ----------------- wi

  • Apple Composite AV Cable

    I purchased the composite cable to watch TV shows and movies I downloaded to my iPhone4 from my at&t Uverse app.  It won't play TV shows or movies from that app.  It won't play movies or TV shows from the HBOGO or MAXGO apps. either.  The only movies

  • LMS 3.2.1 not discover ML cards(ONS)

    I have installed LMS 3.2.1 and RPM(ATM technology) can be seen but not ML card(ONS). Also LMS discovered lot of interfaces (int vlan) one of the core switches and marked them as 'unreachable'. How can delete these when LMS marked as unreachable? Any