ADF ProcessScope -- I get a new AdfFacesContext on each page load

I am trying to store some variables in the ADF processScope. But the next time the page is loaded and calls the managed bean methods, the AdfFacesContext is different, and so the processScope is empty. The managed bean is session scope, and I am setting the processScope variables in the bean's Java code.
In particular this happens when I click on the af:table pagination links, e.g. the "next 25".
How can I get access to the same AdfFacesContext (and therefore the same processScope) the next time the page loads and calls the managed bean?
I am using JDeveloper 10.1.3.3.0.
Here is the example code, and the output that is produced from my System.out.println statements:
========== Controller.java (session scope managed bean) ===============
package adfproject;
import java.util.Map;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import oracle.adf.view.faces.context.AdfFacesContext;
public class Controller {
private List<Map> list = new ArrayList<Map>();
private String label;
private static int counter;
public Controller() {
// initialize list with Map objects
for ( int i = 1; i<10 ; i++) {
Map map = new HashMap();
map.put("A","first column");
map.put("B", "row " + i);
list.add(map);
// called from JSP to initialize the ECO bean
public String getLoad() {
printAdfProcessContext("in getLoad");
// get value from current process scope
String currentLabel = (String)getProcessAttribute("LABEL");
// print currentLabel
System.out.println("current LABEL = "+currentLabel);
// if currentLabel null, build new one with counter, incr counter
if (currentLabel == null) {
label = "xyz " + ++counter;
System.out.println("new LABEL: "+label);
// remember the current label in the process scope, and in member
setProcessAttribute("LABEL",label);
return ""; // empty string so nothing is displayed on web page
public static void printAdfProcessContext(String label) {
AdfFacesContext afCtx = AdfFacesContext.getCurrentInstance();
System.out.println("============ "+label+" ===========");
System.out.println("AdfFacesContext = "+afCtx);
Map ps = afCtx.getProcessScope();
System.out.println("Process scope = "+ps);
* Get attribute from ADF "processScope".
* This is a special scope provided by ADF which is in between Session
* and Request.
* @param name attribute name
* @return
public static Object getProcessAttribute(String name) {
AdfFacesContext afCtx = AdfFacesContext.getCurrentInstance();
return afCtx.getProcessScope().get(name);
* Add or overwrite attribute in ADF "processScope".
* This is a special JSF "scope" provided by ADF Faces which is somewhere
* between Session scope and Request scope. It can be accessed in JSF
* pages using the EL expression #{processScope.myAttribute}.
* @param name attribute name
* @param value attribute value
* @return
public static void setProcessAttribute(String name, Object value) {
AdfFacesContext afCtx = AdfFacesContext.getCurrentInstance();
afCtx.getProcessScope().put(name,value);
public String getLabel() {
return label;
public List<Map> getList() {
return list;
============= jsftest.jsp =====================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
<f:view>
<afh:html>
<afh:head title="ADF Context Test">
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252"/>
</afh:head>
<afh:body>
<h:form>
<af:outputText value="#{controller.load}"/>
<h:panelGrid columns="2">
<af:outputLabel value="LABEL"/>
<af:outputText value="#{controller.label}"/>
<af:outputLabel value="Map"/>
<af:table emptyText="No items were found" value="#{controller.list}"
var="row" rows="4">
<af:column sortable="false" headerText="A" formatType="text">
<af:outputText value="#{row.A}"/>
</af:column>
<af:column sortable="false" headerText="B" formatType="text">
<af:outputText value="#{row.B}"/>
</af:column>
</af:table>
</h:panelGrid>
</h:form>
</afh:body>
</afh:html>
</f:view>
================= Console Output when page loads initially ==================
08/09/03 15:27:18 ============ in getLoad ===========
08/09/03 15:27:18 AdfFacesContext = oracle.adfinternal.view.faces.context.AdfFacesContextImpl@101751
08/09/03 15:27:18 Process scope = ProcessScopeMap@7009019[_map={}, token=null,children=null]
08/09/03 15:27:18 current LABEL = null
08/09/03 15:27:18 new LABEL: xyz 1
======= Console Output when I click the "next 4" link on the table, and the page reloads ========
08/09/03 15:32:42 ============ in getLoad ===========
08/09/03 15:32:42 AdfFacesContext = oracle.adfinternal.view.faces.context.AdfFacesContextImpl@16bf9ce
08/09/03 15:32:42 Process scope = ProcessScopeMap@31287037[_map={}, token=null,children=null]
08/09/03 15:32:42 current LABEL = null
08/09/03 15:32:42 new LABEL: xyz 2
====== Comments =========
As you can see above, the AdfFacesContextImpl object has changed, so I have lost the ProcessScopeMap.
Also, on the displayed page, the label is still "xyz 1" instead of changing to "xyz 2".
Thanks for your help,
JbL

Thanks for the idea, Murph.
I didn't need a session scope bean, request would be fine, I just was trying to make something work that would allow me access to the process scope attributes. I want to allow multiple browser windows searching on different objects independently, so I don't want to use session scope.
I tried removing the variable declaration and setting/getting the processScope attribute in the setter/getter methods, to make the process scope attributes independent of the managed bean. But each time the page loads (by clicking the table navigation links), I still lose the process scope attributes. I tried with both session and request scope beans. Either way, in the getLoad() method, when I try to get the label from the process scope (using the new version of getLabel()), it is null.
So the root problem is still there.
For continued discussion on this more specific problem, see my separate thread "JSF ProcessScope attribute missing on page reload from af:table pagination"
at JSF ProcessScope attribute missing on page reload from af:table pagination

Similar Messages

  • OCI bowser generates new session with each page load

    Here is a summary of my problem:
    I am trying to implement the SAP Open Catalog Interface (OCI) with our eCommerce software, but I am having issues with the Web browser that OCI uses.
    Our eCommerce software utilizes the browser session id to identify the user. Our issues is that the OCI browser supplies a new session id with each page load.
    The weird part is that if I open a standard instance of IE, access the site, and then access the site though OCI the same session is shared by both the OCI browser and the IE browser. The OCI browser is now able to maintain the session ID as the user browses the site.
    Thanks.

    Thank you for your quick response.
    I understand that session IDs are always unique, and should only last for as long as the instance of the browser is open.
    What I have seen happen is that the session ID will get recreated with each page load with in a single instance of the OCI browser.
    When the site is opened in OCI it logs the user in, and then redirects them to the homepage. The problem is that the load of the login page, and the load of the homepage have different session IDs. If the user then clicks on a link on the homepage that page load will again have a different page load. This causes the eCommerce system to see them as separate users.
    As I described when I open an instance of IE first it seems to work. This leads me to believe that the OCI browser can read the cookie information, but can't write or create. 
    I am trying to figure out why the OCI browser keeps generating new Session IDs.

  • How to get windows username printed on each page irrespective of application? we have cm6030f.

    How to get windows username printed on each page irrespective of application? we have HP CM6030F.

    Hi,
    Normally, you will receive a Windows Azure Pass from your local Windows Azure team. Please try to contact your local Windows Azure contact (http://support.microsoft.com/gp/customer-service-phone-numbers?wa=wsignin1.0
    Also, you could see this page
    http://www.windowsazurepass.com/AzureU/AcademicFAQ and apply the free trial azure via (http://www.windowsazurepass.com/AzureU/).
    Q: I am a student. Can I apply for a pass?                     
    A: Windows Azure Educator Grants are only for valid faculty. If your faculty has been awarded a Windows Azure Educator Grant, you will be able to get a pass through him/her for you coursework. If you are interested in learning more about Windows Azure,
    we encourage you to share these Educator Grants with your faculty or sign up for the FREE 3-month trial offer. 
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • 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

  • I am trying to get a footnote repeated on each page of a report- it only appears on first page - how do I make it appear on each page please?

    How do I get the same footnote to appear on each page of a report - it only shows on  the first page?? I went in through View and Layout per instructions. Thanks.

    Hard to tell w/out knowing exactly which application and version you are drafting this report in.  Often the footer on the first page is distinct from the footers of the second page through end - quick fix: add the footer to the second page and you should then be able to format it to continue on through the end of the report.

  • Firefox doesn't respond when opening a new tab until the page loads completely

    When I open a page in a new tab, Firefox freezes until the new page loads completely. I can't switch tabs or do anything. It then works normally. Older versions of Firefox did not have this problem; it only started after I updated a few months ago. What can be done about this problem?
    Thanks.

    Please check for the problem in [[safe mode|safe mode]].. does it work there?

  • Whay after new firefox download all pages load so much more slowly

    I have been prompted twice in the last couple of days to download new firefox updats.
    Since then, my web pages load very much more slowly than they ever had before. I have tried the usual system maintenance tools with no improvement in efficiency or speed.
    The downloading process states it disables quite a few normal operating systems involving Java and Adobe etc. Why?
    It seems you are improving firefox at the cost of the rest of the system. How is that supposed to help any web use?

    Everything is probably working fine for most of 400 million Firefox users. Whatever the problem is it will probably only affect a few users, and may well be due to something to do with how you have Firefox set up on your computer.
    If you are able to provide more information it helps us in trying to help you. As they say a picture is worth a thousand words, so attaching a couple of screenshots of the problem pages may assist us.
    The suggestions in my first post did '''not''' involve installing and uninstalling anything, just simple tests and changes using mouse clicks. In fact I pointed out a reinstall may not solve problems.
    (A special clean reinstall, or setting up a new profile does sometimes help, but first of all lets just try to find out first of all what you are seeing on your own computer screen)

  • Why am I prompted to get a new access code each I time I use Viber?

    I have both an iPhone 5 and an iPad (4th Gen) and am getting tired of having to obtain a new code each time I use Viber and have to resubmit my phone # and name details!  Can anyone help?!

    Request help for Viber here:
    http://helpme.viber.com

  • I can not get the new verison of Itunes to load and it will not let me open my old one.

    I can not ge the new iTunes to load and it will not let me open the old one.

    Do you get an error message when you try to open iTunes? If so, what does it say? (Precise text, please.)

  • Script to get the first word on each page

    Is there a script that would make a list of the first word of each page (or, preferably, create a text box on each page and place the next page's word in that)? My document's all in one story with one text frame on each page, although there are several other frames (header, page number) applied through master pages.

    You wrote:  I changed the numbers to "8.0425in",  "4.5681in",  "8.1275in", "5.4319in" and it mostly worked - it placed the box at exactly 5 inches (X) and at 8.085 inches (Y) instead of 4.5681 inches. Any idea why?
    No. I cannot reproduce the error you describe. I assume you've checked your numbers very closely in the script--I don't normally indicate measurements as strings.
    you wrote: Something wasn't working with the styling - it kept freezing the program -
    What do you mean by "freezing the program"? Is there a specific error message?
    The paragraph style is named "firstword" and is all lowercase letters?
    firstword paragraph style is NOT in a paragraph style group, right?
    Is the first word on any page too long when formatted with the paragraph style "firstword" to fit in the text frame?

  • When I set up multiple home pages, I get two NEW pages when I click "home"

    Firefox 19.0.2 on XP
    I have always had firefox set up to open two page, so my home page setting reads
    https://www.google.com|https://www.google.com
    When I open Firefox, I get two tabs, both on Google. If I opened a 3rd tab I got a blank page. Just what I wanted.
    Now, suddenly - when I open Firefox, I get my two home pages, but if I'm in Page 0 and click HOME, I get TWO MORE tabs open to my home page (for a total of 4 pages).
    I read online to replace the pipe with %7C but that causes a -27 Service error.
    Something changed inside FF in the latest updates ... how do I get the expected behavior back?

    I have had the same original problem here as dbdataplus12 for a while now concerning having multiple tabs set as home page.
    For my use, I have 4 tabs set up as home pages - each tab being set to a different web address, as I always use all 4 websites whenever I start any browsing sessions.
    I had given up hope of trying to find an answer to resolve it or at least find out why it happens.
    If it's just because it's the way FF works then so be it, and I'm stuck with FF doing something that, as far as I'm concerned, it shouldn't really be doing that way - but I'll have to put up with it anyway ;)
    But having come across these replies to dbdataplus12 query it's prompted me to have to post here.
    I can see why dbdataplus12 basically gave up on trying to get a clear answer to his query. "That said, I'm bored with this entire conversation - and now I will do what true Americans now do in cases like this - I will lower my expectations. "
    So maybe I can explain better what I see as my problem with multiple home pages, what is happening within FF and why I think that it shouldn't be doing things that way, and what I think FF should be doing instead.
    If it turns out that I'm just expecting too much from FF or the people who program FF, or maybe my expectations are too high to have something so obvious be able to be done - that just doesn't happen in FF, or maybe just plain wrong of me to expect certain things from a tool such as FF - then so be it ;)
    As dbdataplus12 said " ... if I set up my home page option with TWO home pages (google | yahoo) then when I open FF I get two tabs with their respective pages loaded."
    When I startup FF I get my 4 tabs opened to their respective web addresses. So far so good :)
    I then use those 4 tabs during my session, and again so far so good ;)
    The problem then happens when I wish to go to my home pages again.
    On clicking the Home button, a new set of 4 tabs open up, each going to their respective web address as they are supposed to.
    Why aren't the original, existing tabs used to go to the home pages?
    I would have thought that it was obvious that when I click on the Home page button that the 4 tabs that are open go to the home pages.
    If I had closed one or more tabs then I would expect FF to open new tabs as required, and use those tabs to go to the relevant home pages.
    If I had opened new tabs myself during my session to visit other web addresses, I would expect that the first tabs be used to go to the Home pages - any other tabs that may be open would stay on their relevant pages.
    That's what I would expect to happen.
    Not for FF to just open up 4 new tabs.
    As I say, to me, it's just plain obvious.
    The first tabs onscreen should be used to open up any Home pages set up, so that whenever the Home page button is pressed those tabs are used.
    And for FF to open up additional tabs, if tabs had been closed and are needed to enable all the home pages to be shown.
    As I say, to me, it's just plain obvious.
    So, if it's just that FF doesn't work that way - then so be it. I'll accept that as the answer and have to put up with new tabs opening every time I press Home ;)
    But maybe someone, somewhere, could think about altering FF so that it uses existing tabs etc instead of just opening new ones. Maybe you could have a setting in the preferences to switch the option on or off to reuse tabs whenever the Home button is pressed.
    Just a really, obvious idea ;)
    Thanks for reading - and hopefully replying.
    And hopefully taking the idea onboard ;)

  • ADF Question: included jsp action firing after page load

    Hi all,
    I am using JDeveloper 10.1.3.3 and ADF + BC.
    Here is another interesting situation for you. I have a page with an included jsp at the top with tabbed navigation.
    My page is for entering an order. Users can have multiple orders "open" in other tabs at the same time. Users can also have many other non-order pages opened in tabs. We are using the same View Objects (Entity Based) along with Transient View Objects on each order.
    Each order tab needs to "remember" the orderId so that when the user clicks on a tab, the appropriate rows are set in the order that is to be "opened". This occurs in a tab's action() - setting the orderId and forwarding to the appropriate page (if different) or reloading the same page with the new id.
    On page load we try to get the tab's orderId and load that as the current row of all of our view objects. This should make it seem like they are all concurrently running.
    The problem is when going from order to order, once the tab is clicked, the page's OnPageLoad method runs BEFORE the action of the tab click is processed. Therefore the order that loads thinks it is the previous order, and does not load the correct View Object rows.
    Does anyone know how we can force the tab action to occur before the page load so that we can get the proper orderId?
    Thanks,
    Heather

    Thanks for your speedy reply Frank,
    We are using the onPageLoad from the OnPageLoadBackingBeanBase which implements the PagePhaseListener.
    In this we are doing something like:
            if (isPostback()) {
                String selectedTabNum =
                    EL.getAsString("#{TabCounter.currentSelectedTab}");
                String test = EL.getAsString("#{TabCounter.tabOrderId" + selectedTabNum + "}");
                System.out.println("tab num " + selectedTabNum);
                System.out.println( "testing " + test );
            }our tab counter (a session bean) has these two methods (among others):
        public void setCurrentSelectedTab(int currentSelectedTab) {
            this.currentSelectedTab = currentSelectedTab;
            for(int i=1;i<= 20; i++) {
                EL.set(BACKING_START+"selectedTab"+i+"}", false);
            EL.set(BACKING_START+"selectedTab"+currentSelectedTab+"}", true);
        public String getNextAvailableTab () {
            for(int i=2;i<=20;i++) {
                boolean isTab = (new Boolean (String.valueOf(EL.get(BACKING_START+"render"+i+"}")))).booleanValue();
                if (!isTab) {
                    return String.valueOf(i);
            return "0";
        }our tab header (request bean) has this method as the action for clicking a tab:
            System.out.println("handleTabNavigation");
            String componentId = actionEvent.getComponent().getId();
            String selectedTab = componentId.replaceFirst("tab","");
            int selectedTabNum = new Integer(selectedTab).intValue();
            EL.set("#{TabCounter.currentSelectedTab}", selectedTabNum);
            String tabType = EL.getAsString("#{TabCounter.tabType"+selectedTabNum+"}");
            if (tabType.equals("regular")) {
                String orderId = EL.getAsString("#{TabCounter.tabOrderId"+selectedTabNum+"}");
                EL.set("#{processScope.unfinishedHeaderId}", orderId);
            } else if (tabType.equals("standing")) {
                String orderId = EL.getAsString("#{TabCounter.tabOrderId"+selectedTabNum+"}");           
            }Thanks,
    Heather

  • Create new session for each window opening

    From a jsp page i open a page called student.jsp by clicking on students admision no.Therefore lots of pages can be opend in new windows with relevent student details.
    but when i click on the link i called a servlet, get relevent details and redirect to student.jsp. The problem is ,all opened windows have same session id and there are session conflicts.
    How can i create new sessions for each page thru the servlet or is there any other alternatives

    I actually was working on a problem that was similar to this, and the problem is with how each web-browser works with sessions...
    Each browser window (Except in one case with IE) will use the same session in each window.
    However, you might be able to use URL-Rewritting to manage your sessions and get around using cookies for for session tracking. I personally haven't tried this, but I'm betting that it will work.
    Best of Luck,
    Nate

  • Each request gets a new session problem

    I have a standalone oc4j and I have deployed an application that uses Dynamic JDBC Credentials as described in ½How To Support Dynamic JDBC Credentials½. The application works fine when oc4j runs on every computer except one (the one it should be on). Every time an action is supposed to execute (after the user has logged in) the method createSessionCookie in MySessionCookieFactory gets executed. Although it is the same user and it should be the same session. My guess is that a new application module or a new session is started for some reason. What could the reason be?

    Hi,
    What version of JDeveloper are you using? If you have used 10g to develop an ADF/Struts application then you will need to reference the updated dynamic JDBC credentials HOWTO for this type of application.
    Please note that the new version of the HOWTO only applies to ADF applications developed in 10g -- the older version will still work for 9.x applications that have been migrated to 10g.
    The issue with the 9.x version is that it does not get in front of the ADFm/BC4J bootstrap that is now being performed by an ADF servlet filter.
    The new version is expected on OTN in the next week or so.
    I do not know why a new session is required for each request. Have you disabled session tracking for this servlet container?
    Hope this helps,
    JR

  • 'Get All New Data Request by Request' option not working Between DSO n Cube

    Hi BI's..
             Could anyone please tell me why the option ' Get one Request only' and  'Get All New Data Request by Request' is not working in DTP between Standard DSO and InfoCube.
    Scenario:
    I have done the data load by Yearwise say FY 2000 to FY 2009 in Infopackage and load it to Write-optimised DSO (10 requests) and again load Request by request to Standard DSO and activate each request. I have selected the option in DTP's to  'Get All New Data Request by Request' and its working fine between WDSO and SDSO. But not working between Cube and SDSO. While Execute DTP its taking as a single request from SDSO to Cube.( 10 request to single request).
    Regards,
    Sari.

    Hi,
    How does your DTP setting looks like from below options ? It should be change log, assuming you are not deleting change log data.
    Delta Init. Extraction from...
    - Active Table (with archive)
    - Active Table (without archive)
    - Archive ( full extraction only)
    - Change Log
    Also if you want to enable deltas, please do not delete change log. That could create issue while further update from DSO.
    Hope that helps.
    Regards
    Mr Kapadia
    *Assigning points is the way to say thanks*

Maybe you are looking for

  • Javascript error on launching application from portal

    When we launch  BW reports from our portal (Netweaver 7.0) , it gives a javascript error  and the reports would not launch  for some users. The launch pad is using WEBDYNPRO-ABAP . The javascript error that we are getting  is - u2018Childnodes.length

  • PDF distribution to include documents that have been linked

    Hi, we have some large PDF documents (for medical device regulation), in which we have hyperlinks to documents stored on our server (e.g. test reports).  Is there a way to enable us to distribute this PDF portfolio AND INCLUDES the documents referred

  • Abandoned soul

    WIth latest 10.5.2 OSX installed, updated, and running well on my MacPro, hundreds of images would not import from iPhoto into Aperture 2.0. No common element. jpegs, raws, horz, verts all random. Aperture says those not compatible but iPhoto viewer

  • Some videos missing from iPhoto event in iMovie'08

    I recently took some pictures and 7 videos and imported them into iPhoto. I intended to edit them in iMovie'08. I find that 3 of the videos are missing in the Event Library/iPhoto Library pane. I tried deleting them from iPhoto and importing again to

  • Regarding Log4.xml to add timestamp in log file

    Dear Sir, Could you guide me how to append the timestamp got appeared in log file which has been generated from Log4j.xml?? This is my Log4j.xml. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configur