I am getting a PageExpiredException.  I believe it is related to a user
opening multiple browser windows.  They are using the same session and
accessing the same page at the same time.  I was thinking that the page
will expire in one window but not the other for some reason.
 
User actions;
1. Open a window (with that Page)
2. Open another (with that Page) 
3. Click around in one window for a couple of minutes
4. Maybe the user will go BACK to the first window and click
5. Receive PageExpiredException when they click on an ajax component.
 
I can concede that maybe having having multiple windows and accessing
the same session is not a good idea.  I can restrict the user such that
they only open one window.
 
But, I just wanted to know if anyone had this issue and why. 
 
Here is the strange part, if the user clicks fast enough in both
windows, window-a and window-b then they DON'T get the
PageExpiredException.  But if the user waits a minute or maybe around 30
seconds on one page, they get the PageExpiredException.
 
Maybe the page is written to disk after 30 seconds or so?
 
 
Here is essentially the page structure:
 
Version: Wicket 1.4.15
 
Error:
 
org.apache.wicket.protocol.http.PageExpiredException: Cannot find the
rendered page in session
[pagemap=null,componentPath=2:radio,versionNumber=0]
 at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequ
estCycleProcessor.java:197)
 at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
 at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
 at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
 at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484
)
 at
org.apache.wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:
160)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
 at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.ja
va:1146)
 
Most of the code:

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.apache.wicket.PageParameters;
import org.apache.wicket.ajax.AjaxRequestTarget;
import
org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.RadioChoice;
public class TestPage extends WebPage {
    public static class OptionBean implements Serializable, Cloneable {

        private String name;        
        private String value;                        
        public OptionBean() {
            this( null, null );
        }        
        public OptionBean( final String name, final String value ) {
            setName( name ); setValue( value );
        }
        public String getName() { return name; }       
        public void setName( final String name ) { this.name = name; }

        public String getValue() {
            return value;
        }
        public void setValue( final String value ) {
            this.value = value;
        }        
    }    
    final static List< OptionBean > yesNoList = new ArrayList<
OptionBean >();
    final static OptionBean YES_OPTION = new OptionBean();
    final static OptionBean NO_OPTION = new OptionBean();
    static {
        YES_OPTION.setName( "Yes" ); YES_OPTION.setValue( "1" );
        yesNoList.add( YES_OPTION );
        NO_OPTION.setName( "No" ); NO_OPTION.setValue( "0" );
        yesNoList.add( NO_OPTION ); 
    }    
    public TestPage() {
        this(null);
    }    
    public TestPage(final PageParameters p) {
        super(p);        
        final RadioChoice rc = new RadioChoice("radio", yesNoList);
        rc.add(new AjaxFormChoiceComponentUpdatingBehavior() {
            @Override
            protected void onUpdate(AjaxRequestTarget target) {

            }           
        });
        this.add(rc);
    }
}

 

Reply via email to