I have a strange problem. I use Spring View Scope (a custom one), that works well in my entire page. The system design allows me to use pages without parameters, so everything works great with pretty faces.
But one of the pages must receive parameters from the URL, to which I followed the docs and passed the parameters using a Bean and an Action. Great. The problem is that every AJAX call on the page calls the action. That could be workaround’ed, but all the attributes in the Bean are erased when this happens, the URL parameters included, but that should not happen since I didn’t redirect the page.
I used the parameter onPostback=”false” on the Action, and it worked, no calls are made to the Action method besides the original request. But it also disables every AJAX request on the page. I really can’t find a way out of this.
Can someone help me?
Hey there, this sounds like a tricky problem. Any chance you could post a small sample (maven if possbile) application that reproduces this problem so we can take a look? What server are you running on?
I cannot send a sample of the project, Lincoln, since we use some intern libs that can be the cause of the problem (the custom view, as an example).
Christian, when I set onPostback=false no AJAX works. I made a workaroung getting the URL parameters from the request, so I don’t suffer from NullPointerExceptions anymore, but it stills have to initialize all data again (some of it is heavy DAO operations) at every AJAX request.
It seems that my Bean is working in Request Scope, although I have it annotated with View Scope.
Maybe the problem is the scope + pretty parameters, we use the custom view scope coded in this website.
This reply was modified 2 years, 4 months ago by Ryaryu.