...
Code Block |
---|
public class MyPage extends WebPage { public MyPage() { WebMarkupContainer c=new WebMarkupContainer(); c.add(new AbstractBehavior() { public void renderHead(IHeaderResponse response) { response.renderJavascriptReference(new PackageResourceReference(YuiLib.class, "yahoo-dom-event/yahoo-dom-event.js")); } }); add(c); } } |
RequestCycle
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.
Code Block | ||||
---|---|---|---|---|
| ||||
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.
List of renamed classes and methods
...