All day I try to run JMeter tests of my JSF application.
I am aware of ViewState
, but it seemed to be quite simple issue. I prepared Regular Expression Extractor:
Reference Name: jsfViewState
Regular expression: id=\"javax.faces.ViewState\" value=\"(.+?)\"
Template $1$
Match No. 1
The following samplers are created with proxy and recording.
First request /TourJSF/pages/protected/admin/addTourPage.xhtml
. This is GET
request from which ViewState will be extracted.
The POST
request /TourJSF/pages/protected/admin/addTourPage.xhtml
where .${jsfViewStete}
is passed into javax.faces.ViewState
The second GET
request, now very important in this case.
The results:
First GET
. On the right we can see value of ViewState.
Debug Sampler
which shows that jsfViewState value is correct. We can compare it with the previous screen.
javax.faces.application.ViewExpiredException: viewId:/pages/protected/admin/addTourPage.xhtml - View /pages/protected/admin/addTourPage.xhtml could not be restored.
I found some blogs and topics about this issue but many of them were unsolved. If it is needed I can put links to these topics. I am really confused...
Where is the issue? Maybe something with
jsessionid
?HTTP Header Manager
in every HTTP Request
? I deleted HTTP Header Manager
but nothing changed.com.sun.faces.enableRestoreView11Compatibility
into web.xml
, there was no ViewExpiredException
but the content of returned page was not correct.Aren't you missing a Cookie Manager ?
See:
Also read this: