JSF Spec - State management

Any reason why the spec chose to use the visitor pattern with saving state versus leveraging serialization/externalizable?

Serialization imposes a lot of things we didn't want to require:
- The structure has to remain stable across releases
- You must save the entire object's state (which we do today, but with improvements in the JSP spec, may not need to).
- There's no real guarantees about when serialization will be called or what state your object might be in or what you'll have access to; StateHolder offers just that, as you'll have access to a FacesContext and know when you'll be called.

Similar Messages

  • Information about adf data model's state management in JSF/ADF faces?

    Dear All,
    i am developing an application with JSF/ADF faces + using
    adf data model (EJB, not adf bc)...
    i want to know more about state management of adf data model..
    1. under what condition, will the data in the binding context
    (methodIterator, variableIterator, accessorIterator..etc) be maintained accross
    http requests? say browse pageA.jspx, pageB.jspx, pageC.jspx..then do data
    in the corresponding pages saved somewhere else until session timeout?
    2. how do the binding context data be saved ?? http session?
    i can't find detail information in the adf bc dev guide and the adf dev guide..
    could anyone give me more information about this?? any better document??
    i have asked these question several times...but seem nobody can give me a
    full picture about the adf data model's state management....it is quite important
    in order to develop good application using adf data model.
    my company have brought oracle's support service...can i get these information
    through metalink (open a SR) ?? or actually no such information available ??
    btw, after playing with adf data model for a few weeks, i do find it is very
    hard to learn it... no complete document, information is just by providing example...
    adf data model do make:
    1. simple logic, supported by adf, more simple in coding
    2. simple logic, not supported by adf, more complex in coding
    3. complex logic, much more complex in coding...brain damage..
    lsp

    Hi,
    actually, these pages don't explain the state management about the adf data model's iterators?
    i want to know the state management of the iterators...for some iterators..it's
    state is maintained across requests...
    please see my previous post: ADF JSF data binding: why state maintained between requests? that Frank Nimphius said:
    "in this case its the iterator that survives the page navigation"...
    in the adf dev guide..section 5.5.5..it says: "Upon each request, the iterator bindings are refreshed to rebind them to the
    underlying RowSetIterator objects. By default, the rowset iterator state and the
    data caches are maintained between requests."
    in dev guide, it seems state is maintained for request for the same page, but not
    accross different pages. but in fact, the rowset iterator do survive...
    any detail document that write down the actual behavior of the iterators?
    thank you.
    lsp

  • JSF spec 1.0 prd

    JSF 1.0 prd states in a number of places that the spec will likely change. Could someone enlighten those of us who are not directly involved on the thinking and arguments behind these statements?
    Thanks!
    Song He

    The spec is still being developed; the current draft is the first Public Draft, intended to solicit feedback from people interested in the technology and willing to play with it a bit.
    A number of details are known to require more work, and the sections where the "expert group" is already working on enhancements or alternatives are marked as "will change" in the Public Draft.
    For more on the Java Community Process (used to develop the JSF spec as well as all other "sanctioned" Java specs) and all the stages a spec goes through before it's final, see http://jcp.org.

  • Issue with : Stateful BSP Applications: New State Management Option

    Reference:weblog by Thomas Jung -  /people/thomas.jung3/blog/2004/11/09/updated-stateful-bsp-applications-new-state-management-option
    I see a comment by one user to send the complete code... I am not sure what else can be sent   - try it out rather than getting spoon-fed. - getting offline - sorry...
    I had two issues with this ITSM way of session handling.
    First - if you are using an SP42 environment, check CL_BSP_RUNTIME=>ON_SESSION_CMD() to see if CANCEL is defined as an option. If not make sure that you use &sap-sessioncmd=CLOSE" instead of the &sap-sessioncmd=CANCEL" . If CANCEL is not defined , it will give you shortdumps...
    Second - when I closed the window, the session was not terminated. I used onbeforeUnLoad="exitBSPApplication(); instead of onUnLoad="exitBSPApplication(); and it worked fine. Not sure if it has any other issues.
    But now I am facing a new issue... all but one application is not ending... I have no clue on why this is happening.. I am still checking..
    Thanks Thomas, you are the best, as always...

    Thanks for checking the code in your system.
    After some investigation, I found the behavior as explained below.
    If the actual url has any fields passed as parameters, e.g.. /default.htm?var1=a&var2=2 ...
    - if I use CANCEL as the option, a shortdump is created and the session is not closed. if I use CLOSE, Session is terminated and no shortdump happens.
    If the actual url does not have any parameters, e.g.. /default.htm ...
    - CANCEL does the work, but CLOSE does not exit the session.
    In my applications I used request->get_form_fields to see if there are any parameters, and if there are, then I use CLOSE as the option and else, I use CANCEL. So now, the session
    management works beautifully...
    There is a good chance that I am doing something wrong here too.

  • Multi-page units of work with automatic state management

    Hi Jhs team:
    When my applications need to support an end-user task requiring data entry on many different web pages to complete,
    how to building multi-page units of work with automatic state management ? please give some instruction .

    Ting Rung,
    You can do this in two ways:
    - use a Struts form bean to collect all the values over the requests
    - submit the changes of each request to bc4j, but do not post and commit the changes to the database.
    The latter is easiest. For this to work, you must set the doCommit property of all your save actions in the stuts-condig to false, except for the last save action in the chain of requests.
    In addition, in your application module class, you need to overwrite method postChanges as follows:
    * DO NOT post the changes to the database
    public void postChanges() throws Exception
    // do not post here
    // posting will happen when the commitChanges
    // method on the handler is invoked
    Steven Davelaar,
    Jheadstart Team.

  • I'm using a viewsonic 19" LCD monitor with a powermac 7100/66.  The only resolution available in the monitor control panel is 640x480.  The viewsonic gives me a message to use 1440x900.  The mac specs state it's capable of 1152x870 @ 8 bit. Help!

    I'm using a viewsonic 19" LCD monitor with a powermac 7100/66 running Mac OS 7.6.1.  The only resolution available in the monitor control panel is 640x480.  The viewsonic gives me a message to use 1440x900.  The mac specs state it's capable of 1152x870 @ 8 bit.  How can I get a higher resolution?

    For unsupported resolutions, one may need to see if there are any software
    solutions; maybe the minimum specs of the display are not met by an 8-bit
    color specification of the video card in the computer.
    Does the display support two kinds of connections, another one, plus VGA?
    Could be the display needs some other support for it to work. Drivers?
    VRAM? A different control panel and (third-party) software?
    The limits may vary due to the VRAM on the card. With enough there, and
    with a VGA connection (or supported converter to/from older Mac DB-15)
    and the video graphics card with minimal supported specs will show that.
    Been several years since I've run any PowerMac, & only used a variety of
    Apple CRT color displays with them. Most times, they were very adequate.
    A wider array of original choices appeared in the Displays control panel...
    So I suspect the lack of video support in the graphics card or VRAM, to be
    a player in this resolution limit you see in the control panel. A later CPU/GPU
    and better hardware, later Mac OS, offered greater support for newer driver
    along with better results.
    There may not be a workable upgrade to a different graphic video card for
    that old a vintage computer; or if there was one, to locate that now may be
    a next-to-impossible mission. Was there any hints in the web site for older
    Macs, the LowEndMac site, or others? Some are no longer current sites.
    In any event...
    Good luck & happy computing!

  • Oracle9iAS State Management

    Does anyone have any information regarding how the 9iAS tackles the issue of state managment?

    Does anyone have any information regarding how the 9iAS tackles the issue of state managment?

  • Use State Management for Savepoints

    Hello
    i read a topic in the oracle adf 11.1.2 developer guid about Use State Management for Savepoints the Topic index is 43.9.1 How to Use State Management for Savepoints
    have any one try a sample based on it plz
    regads mohammad j.b.yaseen

    Hi,
    have a look at page 6 of http://www.oracle.com/technetwork/developer-tools/adf/learnmore/007-cancelform-savepoint-169126.pdf
    "Explicit ADFm Savepoints in ADF Task Flow"
    Frank

  • Cookie + State Management

    Hi Friends,
    Could you someone point me to RFC's or other useful information for state management using cookies.
    I DO NOT want to know how I can use cookies for state management, but I want to know how it is done behind the screen....
    For e.g
    Difference between persistent cookies and memory retained cookies.
    How cookie data is communicated between browser and server.
    How closing a browser during a session affect the cookie create etc etc...
    Hopefully I described clearly what I am looking for....
    Appreciate you guys time.
    Kumar.

    Difference between persistent cookies and
    memory retained cookies. If a cookie does not have it's expires attribute set, it expires when the user closes their browser. Otherwise, the cookie expires when the specified date and time is reached.
    How cookie data is communicated between browser and server.Through "http requests" and "http responses". A browser sends an http request to a server to request a page. The http request automatically includes all cookies that the server previously set. A server can set a cookie by adding a cookie in the "http response" that is sent back to the browser in response to the browser's request.
    How closing a browser during a session affect the cookieA session cookie expires and it is destroyed. A cookie with an expires attribute that has been set persists until its expiration date.
    Could you someone point me to RFC's
    or other useful information for state management
    using cookies.www.google.com. Type in 'cookies' and pick any of the thousands of hits and start reading. Then maybe try "java sessions" or "java cookies". And even "http request response".
    You might also consider the book Head First Servlets & JSP.

  • State Management for SubTabs

    Hi,
    I need to enable state management for the tabbed regions. I need to limit the scope of the VO till the user is navigating in that sub tab. If an event is raised outside this tab with any pending changes in the selected tab, i need to raise a warning. I went through the dev guide and it seems i can handle this at page level. Any pointers how i can do the same setup at aub tab level.
    Also,
    when i navigate between the tabs, the changes which i do not commit are retained. Can you please guide me if there is a way to override this default functionality.
    Thanks,
    Ankit

    Ankit,
    Thanks for the input. Actually i had the same understanding on the subject after reading the text on the save data changes in the dev guide. I did try setting the "Warn about Changes" option = True at page level. In fact i set this option =True where ever i could find :). But when i leave the tab and go to the next tab it still doesn't display any warning.
    I assume this to be true :)Just to mention that i have one AM and one CO for the entire page. So i guess the warning is not displayed as i remain in the same page and navigate in the sub components of the page only. Is there any easy way of enabling this . My code however is giving the required functionality. But you are right to say that if framework offers the same feature we should definitely use that instead of coding.
    Take an example... if you redirect to same page retaining the AM, the save data change property logic would work, so even in subtablayout, when u click another region... what happens, process request is called again, so this logic should work.If it doesn't then could be a possible bug in framework. In what mode r u running subtablayout tabs?--Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to set  state-manager ? need to help!

    In my App I use Myfaces1.2.6 + RichFaces3.3.0, the <state-manager> setting in faces-config.xml which is right?
    NO.1:
    <state-manager>org.apache.myfaces.application.jsp.JspStateManagerImpl</state-manager>NO.2:
    <state-manager>org.ajax4jsf.application.AjaxStateManager</state-manager>And what is different between NO.1 and NO.2 , and do not set anything in <state-manager>?
    Edited by: ben_gan on Mar 12, 2009 3:18 AM

    1 will use MyFaces' state manager.
    2 will use Ajax4jsf's state manager.
    No setting will likely pick up the default setting, which is most probably the MyFaces state manager.

  • JAR Files with KM State Management API

    Hi all,
    Can you please tell me where can i find the JARs that have KM State Management API classes, such as IState or IStatemanagementManager? I have run JarClassFinder on my NWDS directory and they haven't been found, neither i have access to look for them in PCD on server. Does anyone know the name of these JAR Files?
    Thanks in advance
    Thiago

    Hi!
    Please correct me if I'm wrong, but it is
    km.shared.repository.service.statemanagement_api.jar
    However I am on EP6 SP2 with Eclipse 2.1.3 so I don't know if it is different from NWDS to find it. Try a search in the usr directory .

  • JSF and links with parameters to restore jsf page state

    Hi,
    I've been developing a forum using JSF. It's going to be something similar to the one we are just using.
    If a user, while browsing forum, find something interesting he should have a possiblity to copy URL form his browser and give it to his friend.
    The URL should contain all necesary parameters to restore a same view (a subpage of a forum etc) a first user had. What's best approach to do it ?
    Say, I have a few AJAX components on a forum page, how can I restore their states ? What's even more interesting how can I generate add parameters to URL in a browser ?
    I've found a good solution for my problem:
    [http://ocpsoft.com/prettyfaces/]
    "PrettyFaces is an OpenSource extension with enhanced support for +JavaServer
    Faces+ - JSF 1.1, 1.2 and 2.0 - enabling creation of bookmark-able,
    pretty URLs. PrettyFaces solves the "RESTful URL" problem elegantly,
    including features such as: page-load actions, seamless integration with
    faces navigation, dynamic view-id assignment, managed parameter
    parsing, and configuration-free compatibility with other web frameworks"

    best approach would be http://www.phpbb.com/ :-)
    seems crazy going to all that hassel, phpbb is so simple, infact a lot of jsf forums such as primefaces [http://primefaces.prime.com.tr/forum/] use phpbb, as you can have your fourm up and running in no time
    Edited by: pNev on 3 Meith 2010 00:38

  • Can't get JSF to access managed bean methods from web page

    I'm using NetBeans 6.7.1 and Glassfish v2.1
    Having problems here can somebody please help? It is really
    frustrating because I have written apps like this before in fact I
    used one as a model to create an even simpler app and still can't get
    it to work. I ran it through the debugger and it stops in the
    constructor so it looks like the bean object is being created, but the
    setUid method and the testit method are not being entered when I click
    on the enter commandbutton. Can somebody PLEASE give me an idea as to
    what might be going on? I am totally stumped and this is holding up
    some important work I need to get done. Any help would be greatly
    appreciated:
    web.xml:
    - Show quoted text -
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <context-param>
    <param-name>com.sun.faces.verifyObjects</param-name>
    <param-value>false</param-value>
    </context-param>
    <context-param>
    <param-name>com.sun.faces.validateXml</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>faces/welcomeJSF.jsp</welcome-file>
    </welcome-file-list>
    </web-app>
    faces-config.xml:
    <?xml version='1.0' encoding='UTF-8'?>
    <!-- =========== FULL CONFIGURATION FILE ================================== -->
    <faces-config version="1.2"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
    <managed-bean>
    <managed-bean-name>testbean</managed-bean-name>
    <managed-bean-class>com.lingosys.quoteest.testbean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/go.jsp</from-view-id>
    <navigation-case>
    <from-outcome>correct</from-outcome>
    <to-view-id>/ok.jsp</to-view-id>
    <redirect/>
    </navigation-case>
    </navigation-rule>
    </faces-config>
    go.jsp:
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%--
    This file is an entry point for JavaServer Faces application.
    --%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>JSP Page</title>
    </head>
    <body>
    <f:view>
    <h1>JAS Generator</h1>
    <p/>
    <h:form id="testForm" enctype="multipart/form-data" >
    <p/>Both fields are required.
    <p/>Enter Test ID: <h:inputText id="pid"
    value="#{testbean.uid}" required="true"/>
    <p/><h:commandButton value="Enter"
    action="#{testbean.testit}"/>
    </h:form>
    </f:view>
    </body>
    </html>
    testbean.java:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package com.lingosys.quoteest;
    * @author mphoenix
    public class testbean {
    private String uid;
    public testbean() {
    int x=0;
    public String getUid() {
    return uid;
    public void setUid(String uid) {
    this.uid = uid;
    public String testit() {
    return "correct";
    }

    MikePhoenix wrote:
    enctype="multipart/form-data"
    Why?
    Oh, in the future please post code in code blocks. Use the CODE button to get them. Use the Preview tab to see if anything went right.

  • Bug of JSF spec?

    I am not good at English. But but... please hear my JSF Problem.
    <h:form>
        <h:inputText id="input1" required="#{true}"/>
        <h:message for="input1"/>
        <h:inputText id="input2" value="#{testBean.value}">
            <f:convertNumber integerOnly="true"/>
        </h:inputText>
        <h:message for="input2"/>
        <h:commandButton/>
    </h:form>From browser:
    1.Input empty string at input1. (this cause validation error.)
    2.Input empty string at input2. (convet to null.)
    3.Click commandButton.
    I hope:
    Display value at input2 is empty string. (My input value is keeped.)
    But result is:
    Display value at input2 is "#{testBean.value}". (My input value is forgotten...)
    In my research:
    1.converter converts empty string to null.
    2."local value" is set to null.
    3.Go to Rnder Response Phase By Input1 validation error.
    4.getValue ignore "local value" if it is null and see VE.
    Uhh... Why getValue method doesn't see isLocalValueSet?
    I can't understand... Please Help me...

    Unfortunately I've had no luck with this solution. In my case I am performing a search using a session scope bean. My results are listed in a dataTable and I have an actionListener on a request scoped bean. All of that works fine.
    faces-config.xml
    <managed-bean>
         <managed-bean-name>searchBean</managed-bean-name>
         <managed-bean-class>com.package.SearchBean</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
         <managed-bean-name>detailBean</managed-bean-name>
         <managed-bean-class>com.package.DetailBean</managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    public class DetailBean
         private String field1;
         private String field2;
         //Bind the dataTable component to the controller
         protected transient UIData dataTable;
         //The object used to populate the row in the table that was selected
         protected transient Object row;
         public DetailBean()
              super();
              FacesContext facesContext = FacesContext.getCurrentInstance();
              Boolean isPostback = facesContext.getRenderKit().getResponseStateManager().isPostback(facesContext);
              if(!isPostback) //always seems to be true
                   if(dataTable != null)
                        row = dataTable.getRowData();
         public void detail(ActionEvent event)
              row = dataTable.getRowData();
              if(row != null)
                   Map<String,String> record = (Map<String,String>)row;
                   setField1(record.get("field1"));
                   setField2(record.get("field2"));
         public String edit()
              //do the edit
              return "success";
    <h:inputText id="field1" value="#{detailBean.field1}" required="true"/>
    <h:inputText id="field2Input" value="#{detailBean.field2}"/>
    <h:outputText id="field2Text" value="#{detailBean.field2}"/>
    <h:inputText id="field2Hidden" value="#{detailBean.field2}"/>
    <h:commandLink id="edit" action="#{detailBean.edit}" value="edit"/>
    <h:messages errorStyle="color:red" showSummary="true"/>     The values from the table are successfully populated and the page is shown with the values:
    field1=test1
    field2Input=test2
    field2Text=test2
    field2Hidden=test2when I clear field1 (required) and submit I have the following:
    field1=
    field2Input=test2
    field2Text=
    field2Hidden=test2
    message about field1 being requiredI would expect field2Text to still retain the value.
    Furthermore if I set the field2Text to readonly="true", it, too, does not retain its value. However in both cases once the required field has a value and is submitted, all values show as expected.
    My only workaround for this is to set my detailBean session scope, but that avoids the problem.

Maybe you are looking for

  • Error while generating Distribution Model in ERP to EWM

    I am trying to generate new distribution Model from ERP to EWM for my warehouse. In system one distribution Model already exists for another warehouse. Below error encountered.

  • I purchased a song, and it won't play. How do I fix it?

    How do I go about getting a song I payed for to actually play?????  I use the same computer or phone to make my purchases, and this has never happened, every other song I downloaded the same night dowloaded correctly, but this one I guess didn't. How

  • How to edit a text message received in Outlook 2013?

    I have a user who has configured his phone to automatically forward text messages to his Exchange account.  When he opens the message in Outlook 2013 he'd like to be able to edit the message like he was accustomed to do in Outlook 2003. For a normal

  • IDVD menus cut off in 4:3 !

    When I use the new "bookshelf" theme in iDVD 6, when displayed on a 4:3 TV, the edges of the menu are cut off, as is a chunk of my text! I have played with the settings on both of my DVD player--both new--and nothing fixes it. iDVD is set to 4:3 aspe

  • Problem printing old photoshop files in CS6

    Hi, Can someone advise, we have Adobe CS6, and when printing already created file in Photoshop we get a error: Problem signature: Problem Event Name:                        APPCRASH Application Name:                             Photoshop.exe Applicat