Search in sources :

Example 1 with UndertowRequest

use of act.xio.undertow.UndertowRequest in project actframework by actframework.

the class ActionContext method forward.

public void forward(String url) {
    E.illegalArgumentIfNot(url.startsWith("/"), "forward URL must starts with single '/'");
    E.illegalArgumentIf(url.startsWith("//"), "forward URL must starts with single `/`");
    E.unexpectedIfNot(H.Method.GET == req().method(), "forward only support on HTTP GET request");
    uploads.clear();
    extraParams.clear();
    bodyParams = null;
    urlPath = UrlPath.of(url);
    UndertowRequest req = $.cast(req());
    state = State.CREATED;
    req.forward(url);
    final RequestHandler requestHandler = router.getInvoker(H.Method.GET, url, this);
    app().eventBus().emit(new PreHandle(this));
    requestHandler.handle(this);
}
Also used : UndertowRequest(act.xio.undertow.UndertowRequest) RequestHandler(act.handler.RequestHandler) PreHandle(act.handler.event.PreHandle)

Aggregations

RequestHandler (act.handler.RequestHandler)1 PreHandle (act.handler.event.PreHandle)1 UndertowRequest (act.xio.undertow.UndertowRequest)1