/*
 * Copyright (C) Lightbend Inc. <https://www.lightbend.com>
 */

package javaguide.hello;

import controllers.AssetsFinder;
import play.mvc.*;

import javax.inject.Inject;

public class HelloController extends Controller {

  @Inject
  public HelloController() {}

  // #hello-world-index-action
  public Result index() {
    // ###replace:        return ok(views.html.index.render("Your new application is
    // ready."));
    return ok(javaguide.hello.html.index.render("Your new application is ready."));
  }
  // #hello-world-index-action

  // #hello-world-hello-action
  public Result hello() {
    // ###replace:     return ok(views.html.hello.render());
    return ok(javaguide.hello.html.hello.render());
  }
  // #hello-world-hello-action

  /*
  //#hello-world-hello-error-action
  public Result hello(String name) {
      return ok(views.html.hello.render());
  }
  //#hello-world-hello-error-action
   */

  // #hello-world-hello-correct-action
  public Result hello(String name) {
    // ###replace:    return ok(views.html.hello.render(name));
    return ok(javaguide.hello.html.helloName.render(name));
  }
  // #hello-world-hello-correct-action
}

@@ -314,24 +314,37 @@
 t index() %7B%0A
+%3C%3C%3C%3C%3C%3C%3C HEAD%0A
     // ###re
@@ -514,24 +514,305 @@
  ready.%22));%0A
+=======%0A    // ###replace: return ok(views.html.index.render(%22Your new application is ready.%22, assetsFinder));%0A    return ok(javaguide.hello.html.index.render(%22Your new application is ready.%22, assetsFinder));%0A%3E%3E%3E%3E%3E%3E%3E e3c37f9ed1 (Fixed %60###replace:%60 tag that led to incorrect docs)%0A
   %7D%0A  // #he

Fixed `###replace:` tag that led to incorrect docs