Repeated postbacks create additional serialized views
-----------------------------------------------------

                 Key: MYFACES-3100
                 URL: https://issues.apache.org/jira/browse/MYFACES-3100
             Project: MyFaces Core
          Issue Type: Bug
          Components: General
    Affects Versions: 2.0.4
         Environment: JBoss 6.0.0.FINAL, MyFaces 2.0.4
            Reporter: Robert M. Gary


Each time a user initiates a post back, another view is serialized in the 
session. As a result, if the user does 20 postbacks (the default number of 
views to save) any other open views quickly get a ViewExpiredException.

1) Deploy the example below
2) Open a browser with a window to the page (http://localhost:8080/Web for 
example)
3) Open another tab in the same browser to the same page (or whatever you need 
to do in your browser to ensure the two pages share a session)
4) On the first page, click "Update foo" button 20 times.
5) Now go to the second page and click "Update foo".
6) Notice the ViewExpiredException

@ManagedBean

@SessionScoped

public class testBackingBean implements Serializable{

 

    private String msg="foobar";

 

    public String getMsg() {

        return msg;

    }

 

    public void setMsg(String msg) {

        this.msg = msg;

    }

 

 

}



xhtml

 



<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html

        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml";

      xmlns:f="http://java.sun.com/jsf/core";

      xmlns:h="http://java.sun.com/jsf/html";>

<head>

    <title>This is a test page</title>

</head>

<body>

 

<h:form>

    <h:outputText value="#{testBackingBean.msg}"/>

 

    <br/>

    <h:commandButton value="Update Foo" />

</h:form>

</body>

</html>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to