Esempio n. 1
0
 private static Result wrapScalaResult(
     scala.concurrent.Future<play.api.mvc.Result> result, long timeout) {
   if (result == null) {
     return null;
   } else {
     final play.api.mvc.Result scalaResult = Promise.wrap(result).get(timeout);
     return scalaResult.asJava();
   }
 }
Esempio n. 2
0
  @Override
  public Promise<SimpleResult> call(Context ctx) throws Throwable {

    Promise<SimpleResult> ret = null;

    // redirect if it's not secure
    if (!isHttpsRequest(ctx.request())) {
      String url = redirectHostHttps(ctx) + ctx.request().uri();
      ret = Promise.pure(redirect(url));
    } else {
      // Let request proceed.
      ret = delegate.call(ctx);
    }

    return ret;
  }
Esempio n. 3
0
 public Promise<Result> onHandlerNotFound(RequestHeader request) {
   return Promise.<Result>pure(notFound(views.html.notFoundPage.render(request.uri())));
 }