public String getUrl() {
    StringBuilder sb = new StringBuilder();
    StringBuilder ori = getOut();
    this.setOut(sb);
    TreeMap<Integer, cn.bran.japid.template.ActionRunner> parentActionRunners = actionRunners;
    actionRunners = new TreeMap<Integer, cn.bran.japid.template.ActionRunner>();
    // line 48, japidviews\AdminController\flashPurchaseList.html
    p("            	"); // line 48, japidviews\AdminController\flashPurchaseList.html
    p(
        lookup(
            "AdminController.flashPurchaseList",
            new Object[] {})); // line 49, japidviews\AdminController\flashPurchaseList.html
    p("            "); // line 49, japidviews\AdminController\flashPurchaseList.html

    this.setOut(ori);
    if (actionRunners.size() > 0) {
      StringBuilder _sb2 = new StringBuilder();
      int segStart = 0;
      for (Map.Entry<Integer, cn.bran.japid.template.ActionRunner> _arEntry :
          actionRunners.entrySet()) {
        int pos = _arEntry.getKey();
        _sb2.append(sb.substring(segStart, pos));
        segStart = pos;
        cn.bran.japid.template.ActionRunner _a_ = _arEntry.getValue();
        _sb2.append(_a_.run().getContent().toString());
      }
      _sb2.append(sb.substring(segStart));
      actionRunners = parentActionRunners;
      return _sb2.toString();
    } else {
      actionRunners = parentActionRunners;
      return sb.toString();
    }
  }
Ejemplo n.º 2
0
 @Test
 public void maxLength() {
   StringBuilder body = new StringBuilder();
   for (int i = 0; i < 1100; i++) {
     body.append("1234567890");
   }
   assertThat(
       status(
           callWithStringBody(
               new MockJavaAction() {
                 // #max-length
                 // Accept only 10KB of data.
                 @BodyParser.Of(value = BodyParser.Text.class, maxLength = 10 * 1024)
                 public Result index() {
                   if (request().body().isMaxSizeExceeded()) {
                     return badRequest("Too much data!");
                   } else {
                     return ok("Got body: " + request().body().asText());
                   }
                 }
                 // #max-length
               },
               fakeRequest(),
               body.toString())),
       equalTo(400));
 }
Ejemplo n.º 3
0
 <A> String renderBody(A a) {
   StringBuilder sb = new StringBuilder();
   if (body != null) {
     body.setBuffer(sb);
     body.render(a);
     body.resetBuffer();
   }
   return sb.toString();
 }
Ejemplo n.º 4
0
  public String bar() {
    StringBuilder sb = new StringBuilder();
    StringBuilder ori = getOut();
    this.setOut(sb);
    // line 23
    p("\n" + "	"); // line 23
    String s = "hi2"; // line 24
    p("	<p>bar hi "); // line 24
    p(s); // line 25
    p("!</p>\n"); // line 25

    this.setOut(ori);
    return sb.toString();
  }
Ejemplo n.º 5
0
  public String foo() {
    StringBuilder sb = new StringBuilder();
    StringBuilder ori = getOut();
    this.setOut(sb);
    // line 15
    p("	"); // line 15
    String s = "hi there"; // line 16
    p("	<p>foo hello "); // line 16
    p(foo2(s)); // line 17
    p("</p>\n"); // line 17

    this.setOut(ori);
    return sb.toString();
  }
Ejemplo n.º 6
0
  public String foo2(String p) {
    StringBuilder sb = new StringBuilder();
    StringBuilder ori = getOut();
    this.setOut(sb);
    final dummyTag _dummyTag1 = new dummyTag(getOut());
    {
      _dummyTag1.setActionRunners(getActionRunners());
    }

    // line 7
    p("	<p>hi "); // line 7
    p(p); // line 8
    p("!,</p> \n" + "	<p>from "); // line 8
    p(request.action); // line 9
    p("</p>\n" + "	<p>OK you can call a tag:</p>\n" + "	"); // line 9
    _dummyTag1.setOut(getOut());
    _dummyTag1.render(p); // line 11

    this.setOut(ori);
    return sb.toString();
  }