コード例 #1
0
  public RatpackWebContext(Context ctx, TypedData body, SessionData session) {
    this.context = ctx;
    this.session = session;
    this.request = ctx.getRequest();

    if (isFormAvailable(request, body)) {
      this.form = FormDecoder.parseForm(ctx, body, MultiValueMap.empty());
    } else {
      this.form = new DefaultForm(MultiValueMap.empty(), MultiValueMap.empty());
    }
  }
コード例 #2
0
 public void redirect(Context context, String location, int code) {
   context.getResponse().status(code);
   String normalizedLocation = generateRedirectLocation(context, context.getRequest(), location);
   context.getResponse().getHeaders().set(HttpHeaderConstants.LOCATION, normalizedLocation);
   context.getResponse().send();
 }
コード例 #3
0
 public void handle(Context context) {
   invoker.invoke(
       new HierarchicalRegistry(context.getRequest(), context),
       GroovyContext.from(context),
       Closure.DELEGATE_FIRST);
 }