Example usage for org.apache.wicket Page getDefaultModel

List of usage examples for org.apache.wicket Page getDefaultModel

Introduction

In this page you can find the example usage for org.apache.wicket Page getDefaultModel.

Prototype

public final IModel<?> getDefaultModel() 

Source Link

Document

Gets the model.

Usage

From source file:org.obiba.onyx.webapp.OnyxRequestCycle.java

License:Open Source License

@SuppressWarnings("unchecked")
private Page newErrorPage(Page page, String... messages) {
    Session.get().cleanupFeedbackMessages();
    for (String msg : messages) {
        if (msg != null) {
            Session.get().error(ExceptionUtils.cleanMessage(msg));
        }//from  w w w .j  ava2s .  c o  m
    }
    Session.get().dirty();

    Page rpage;
    if (page instanceof StagePage) {
        rpage = new InternalErrorStagePage((StagePage) page, (IModel<Stage>) page.getDefaultModel());
    } else {
        rpage = new InternalErrorPage();
    }

    return rpage;
}