Re: How to manage StalePageException

2015-02-18 Thread Martin Grigorov
Hi,

if (e instanceof IWicketInternalException) {return null;}
...

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Feb 18, 2015 at 6:10 PM, dpmihai dpmi...@yahoo.com wrote:

 Can someone confirm if this:

  if (e instanceof StalePageException) {
 return super.onException(cycle, e);
  }

 is the right way to let StalePageException be handled by wicket?

 Is there a problem if the page has PageParameters?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-manage-StalePageException-tp4669601p4669617.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: How to manage StalePageException

2015-02-18 Thread dpmihai
Can someone confirm if this:

 if (e instanceof StalePageException) {
return super.onException(cycle, e);
 }

is the right way to let StalePageException be handled by wicket?

Is there a problem if the page has PageParameters? 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-manage-StalePageException-tp4669601p4669617.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How to manage StalePageException

2015-02-18 Thread dpmihai
Hi.

I have a WebPage which gives me a StalePageException when more requests are
made to it at the same time by same user's page, every one with a different
PageParameters object. I also have an AbstractRequestCycleListener with an
onException method in my application.

I read about StalePageException in this posts:
http://apache-wicket.1842946.n4.nabble.com/StalePageException-handling-issue-td4579247.html
and
http://apache-wicket.1842946.n4.nabble.com/Marker-interface-for-quot-internal-quot-exceptions-td4666099.html#a4666100

As I understand by default Wicket recreates the page when StalePageException
occurs.
It wont recreate the page only if you handle this exception yourself in
IRequestCycleListener#onException().

So my question is how to ignore StalePageException in my code?

 I tried:

public IRequestHandler onException(RequestCycle cycle, 
Exception e) {   

if (e instanceof StalePageException) {
return super.onException(cycle, e);
}

}

and even return null

But know it complains page parameters are not sent:

 Can't instantiate page using constructor 'public ...
(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument
''.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-manage-StalePageException-tp4669601.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org