I am following the play tutorial and I am stuck at roughly 9 mins. The routes file is not getting resolved I did the same thing as shown in the tutorial but still doesn't work.
package controllers;
import models.Bar;
import play.core.Router;
import play.data.Form;
import play.mvc;
import play.*;
import play.Routes;
import views.html.indes;
public class Application extends Controller {
public static Result index() {
return ok(index.render("Hello"));
}
public static Result addBar(){
Bar bar = Form.form(Bar.class).bindFromRequest().get();
bar.save();
return redirect(routes)
}
}
Project Structure -> Modules -> Dependencies -> + -> JAR or directories -> target/scala-#.##/classes_managed
Marking this directory as Sources Root/Generated Sources Root did not work for me, as mentioned in some other S/O posts
It was localhost:9000 itself. I dint try running the server again. Actually the code is not able to identify the routes file which is under conf. I am just trying to replicate whatever is shown in the tutorial but it's not happening!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With