You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

class RequestCycle has changed in 1.5-M1 and WebRequestCycle has been removed.

When we want to override RequestCycle's methods and write our logic codes we can not do it like 1.4.x.

eg.

ReqeustCycle
public MyRequestCycle extends WebRequestCycle {
    @Override
    public void onBeginRequest() {
      //...
    }
    
    @Override
    public void onEndRequest() {
        //...
    }
    
   @Override         
    public Page onRuntimeException(Page page, RuntimeException e) {
        // ...
    }
}

In this case we'll need to extend RequestCycle and Override org.apache.wicket.Application.createRequestCycle(Request, Response) to return our class.

The current entry point is org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach().
For now we'll have to wrap this method with try/finally to simulate onBefore/onEnd.

Exception handles not like 1.4.x too we should create a new ExceptionMapper class to handle that.

  • No labels