Example usage for org.apache.wicket.request.cycle RequestCycle processRequestAndDetach

List of usage examples for org.apache.wicket.request.cycle RequestCycle processRequestAndDetach

Introduction

In this page you can find the example usage for org.apache.wicket.request.cycle RequestCycle processRequestAndDetach.

Prototype

public boolean processRequestAndDetach() 

Source Link

Document

Convenience method that processes the request and detaches the RequestCycle .

Usage

From source file:com.mastfrog.acteur.wicket.WicketActeur.java

License:Open Source License

@Inject
WicketActeur(HttpEvent evt, Application application, PathFactory pf, Charset charset, WicketConfig config,
        ByteBufAllocator alloc, Settings settings, ReentrantScope scope) {
    RequestAdapter request = new RequestAdapter(evt, config.locale(), charset, settings);
    ResponseAdapter response = new ResponseAdapter(response(), charset, alloc, pf);
    try (QuietAutoCloseable closeScope = scope.enter(request, response, response())) {
        ThreadContext.setApplication(application);
        RequestCycle requestCycle = application.createRequestCycle(request, response);
        ThreadContext.setRequestCycle(requestCycle);
        boolean processed = requestCycle.processRequestAndDetach();
        if (!processed) {
            reject();//from   www  .j  a v a  2 s  .  co  m
        } else {
            HttpResponseStatus status = response.status();
            reply(status == null ? OK : status);
        }
    } finally {
        ThreadContext.detach();
    }
}