You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Matus (JIRA)" <ji...@apache.org> on 2019/02/18 14:13:00 UTC
[jira] [Updated] (WICKET-6637) Handling exception Wicket 8
[ https://issues.apache.org/jira/browse/WICKET-6637?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matus updated WICKET-6637:
--------------------------
Description:
Hi,
recently we have upgraded our application, from wicket 7.11 to wicket 8.3.0.
With wicket 7 everything seemed to be fine, however in wicket 8 we have an issue
with handling exception.
In Application we have in init() method:
{code:java}
getRequestCycleListeners().add(new MyRequestCycleListener()); {code}
MyRequestCycleListener implements IRequestCycleListener and override method
{code:java}
@Override
public IRequestHandler onException(RequestCycle cycle, Exception ex) {
Optional<AjaxRequestTarget> target = cycle.find(AjaxRequestTarget.class);
//this part stopped working since it return Optional.empty(), because active RequestHandler
//and RequestHandlerScheduledAfterCurrent are both null
if (target.isPresent()) {
return target.get();
}
IPageRequestHandler last = PageRequestHandlerTracker.getLastHandler(RequestCycle.get());
WebPage page = (WebPage) (last.getPage());
return new RenderPageRequestHandler(new PageProvider(currentPage));
}
{code}
Is this a wicket bug or it was intention to work like this? If it was intentended, is there
any workaround to get the AjaxRequestTarget? Or the approach has changed in wicket 8? Any other ideas?
We think, that this might be caused by https://issues.apache.org/jira/browse/WICKET-6129
Please see attached quisckstart, it worked fine with wicket 7.12
was:
Hi,
recently we have upgraded our application, from wicket 7.11 to wicket 8.3.0.
With wicket 7 everything seemed to be fine, however in wicket 8 we have an issue
with handling exception.
In Application we have in init() method:
<code>
getRequestCycleListeners().add(new MyRequestCycleListener());
</code>
MyRequestCycleListener implements IRequestCycleListener and override method
{code:java}
@Override
public IRequestHandler onException(RequestCycle cycle, Exception ex) {}
Optional<AjaxRequestTarget> target = cycle.find(AjaxRequestTarget.class);
//this part stopped working since it return Optional.empty(), because active RequestHandler
//and RequestHandlerScheduledAfterCurrent are both null
if (target.isPresent()) {
return target.get();
}
IPageRequestHandler last = PageRequestHandlerTracker.getLastHandler(RequestCycle.get());
WebPage page = (WebPage) (last.getPage());
return new RenderPageRequestHandler(new PageProvider(currentPage));
}
{code}
Is this a wicket bug or it was intention to work like this? If it was intentended, is there
any workaround to get the AjaxRequestTarget? Or the approach has changed in wicket 8? Any other ideas?
We think, that this might be caused by https://issues.apache.org/jira/browse/WICKET-6129
Please see attached quisckstart, it worked fine with wicket 7.12
> Handling exception Wicket 8
> ---------------------------
>
> Key: WICKET-6637
> URL: https://issues.apache.org/jira/browse/WICKET-6637
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 8.3.0
> Reporter: Matus
> Priority: Major
> Labels: AjaxRequestTarget, IRequestCycleListener, onException
> Attachments: handlingexception.zip
>
>
> Hi,
>
> recently we have upgraded our application, from wicket 7.11 to wicket 8.3.0.
> With wicket 7 everything seemed to be fine, however in wicket 8 we have an issue
> with handling exception.
> In Application we have in init() method:
> {code:java}
> getRequestCycleListeners().add(new MyRequestCycleListener()); {code}
> MyRequestCycleListener implements IRequestCycleListener and override method
>
> {code:java}
> @Override
> public IRequestHandler onException(RequestCycle cycle, Exception ex) {
> Optional<AjaxRequestTarget> target = cycle.find(AjaxRequestTarget.class);
> //this part stopped working since it return Optional.empty(), because active RequestHandler
> //and RequestHandlerScheduledAfterCurrent are both null
> if (target.isPresent()) {
> return target.get();
> }
> IPageRequestHandler last = PageRequestHandlerTracker.getLastHandler(RequestCycle.get());
> WebPage page = (WebPage) (last.getPage());
> return new RenderPageRequestHandler(new PageProvider(currentPage));
> }
> {code}
> Is this a wicket bug or it was intention to work like this? If it was intentended, is there
> any workaround to get the AjaxRequestTarget? Or the approach has changed in wicket 8? Any other ideas?
> We think, that this might be caused by https://issues.apache.org/jira/browse/WICKET-6129
> Please see attached quisckstart, it worked fine with wicket 7.12
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)