7 Replies Latest reply: Jul 3, 2009 3:22 AM by 680588 RSS

    ADF: Request Scope

      I am developing a Standalone ADF Application. I need to maintain certain values throughout the application run time, till the application is terminated.

      Is there any way to attach the values to the requestScope? Is there any limitation of values to be attached to the request scope?


        • 1. Re: ADF: Request Scope
          John Stegeman

          I assume you are talking about an ADF Faces application (based upon JSF)? If so, request scope will not be able to maintain values throughout the application run time. You want to use session scope (if it's for a user's session) or application scope (if it's global to the app). You can simply create JSF managed beans with the proper scope and store your data that way.

          If you are not talking about JSF (not clear what a "standalone adf application is") - please explain more about what you mean by requestScope.

          • 2. Re: ADF: Request Scope
            Thanks John.

            As you have mentioned, my Application is ADF Faces application (based upon JSF).

            If I need to set values to the Application Scope or Session Scope, how can i archive that?

            Also, I need to set a Text Input or Output box value based on the Command Button or link, Should I have to write any Java Code for the same, or Can I set and bind variable like #{request.outMsg} i.e. Through EL?


            • 3. Re: ADF: Request Scope
              Hi Anjali,

              about how to create session backing bean:

              -create java class with the content:
              package mypackage;
              public class MyBB {
                  private String value = "Frank";
                  public MyBB() {
                  public void setValue(String value) {
                      this.value = value;
                  public String getValue() {
                      return value;
              then in adfc-config.xml :
              <?xml version="1.0" encoding="UTF-8" ?>
              <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
              then create .jspx page:
              <?xml version='1.0' encoding='windows-1250'?>
              <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
                <jsp:directive.page contentType="text/html;charset=windows-1250"/>
                  <af:document id="d1">
                    <af:form id="f1">
                      <af:inputText label="Label 1" id="it1" value="#{myBB.value}"/>
              I hope you got the idea


              • 4. Re: ADF: Request Scope
                Thanks for you update. I have got some idea about the bean.

                But Can you anyone tell me whether is that anything called request Scope?

                I was confused on seeing the tutorial document Tutorial for Forms/4GL Developers.


                • 5. Re: ADF: Request Scope
                  Hi Anjali,

                  These are the different scopes

                  * Application scope lasts until the server stops the application. Values that you store in an application bean are available to every session and every request that uses the same application map.
                  * Session scope begins when a user first accesses a page in the web application and ends when the user's session times out due to inactivity, or when the web application invalidates the session, such as, for example, by calling session.invalidate().
                  * Request scope begins when the user submits the page and ends when the response is fully rendered, whatever page that is.

                  • 6. Re: ADF: Request Scope
                    Thanks Ravi,

                    Can you tell me utmost whats can i do with request scope? store temp values with in the page scope?


                    • 7. Re: ADF: Request Scope

                      if u want to have values passed between pages u can use it ....u can even use a page flow scope ....

                      some thing like this <tr:setActionListener from="#{row}" to="#{requestScope.UserSearchBackingBean.showNoRecords}"/> and u can get the value in the next page using the request scope.