1

In our Application, we get a View Expired Exception when returning from a dialog with many (~40) input fields.

I tested it and I get the same exception at the primefaces showcase.

Steps to reproduce:

  1. go to https://www.primefaces.org/showcase/ui/df/nested.xhtml
  2. click View, then "go to level 2", then click on the x, then click "go to level 2 again", repeat this process around 40 times, then try to go to level 3

you will get redirected to https://www.primefaces.org/showcase/viewExpired.xhtml

I assume that this exception occurs because the site to which the dialog would return is no longer available because only 15 viewstates get saved.

When I increase the parameter

org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION in the web.xml

to 200 I do not get the exception anymore.

Is there a way to avoid this exception without increasing the parameter, because we do not want to waste resources.

We also tried javax.faces.STATE_SAVING_METHOD = client and it worked to but then the network traffic was increased by a factor of 10 (2MB for every request)

EDIT I've got a sum column and the numbers in my input fields should always have two decimal digits, so my input fields look like this.

<p:inputText style="text-align:right;"
    rendered="#{attval.att.ac.catForNumericalData}"
    size="#{attval.att.inputlength}" value="#{attval.att.quantity}">
    <f:converter converterId="com.prosol.faces.converter.DoubleConverter" />
    <p:ajax event="keyup" update="attributeTable" delay="1000"/>
</p:inputText>
JavaMan
  • 1,142
  • 12
  • 22
  • This seems special to Primefaces "dynamic Dialog". On opening level 2, the browser executes a real http-GET. I was surprised, because NUMBER_OF_VIEWS_IN_SESSION counts the views and not the viewstates. So you can do as much AJAX calls as you like. But in the showcase they do a real GET after the AJAX call and after 15 tries the view is gone. I don't know, why your 40 input fields can count any view or viewstates. I think, there is another problem. – Holger Nov 20 '18 at 10:08
  • @Holger, do you think there is a workaround, apart from either not using a dialog or increasing the nr. of views? – JavaMan Nov 27 '18 at 12:20
  • If you want/have to use the "dynamic Dialog" and Primefaces stays with doing a GET, there will be generated new views. I don't know (and you should test) what's about the ViewScoped bean of the main page. I think there can't be 2 ViewScoped beans at a time. But anyway, in the normal case, open dialog, do some input, close dialog, the nr. of views shouldn't be a problem. – Holger Nov 27 '18 at 13:29

0 Answers0