-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello World page does not work #9942
Comments
it's due to the fact that the examples in play-samples-play-scala-starter-example are different from that of in playframework |
You're right. The tutorial is incorrect since |
The tutorial is incorrect for The commit playframework/play-samples@dc2b3fe moved the We have two options:
The problem with option The problem with option public class HomeController extends Controller {
private final AssetsFinder assetsFinder;
@Inject
public HomeController(AssetsFinder assetsFinder) {
this.assetsFinder = assetsFinder;
}
/**
* An action that renders an HTML page with a welcome message.
* The configuration in the <code>routes</code> file means that
* this method will be called when the application receives a
* <code>GET</code> request with a path of <code>/</code>.
*/
public Result index() {
return ok(
index.render(
"Your new application is ready.",
assetsFinder
));
}
} as opposed to the current code: public class HomeController extends Controller {
/**
* An action that renders an HTML page with a welcome message.
* The configuration in the <code>routes</code> file means that
* this method will be called when the application receives a
* <code>GET</code> request with a path of <code>/</code>.
*/
public Result index() {
return ok(
index.render(
"Your new application is ready."
));
}
} Specially considering the tutorial only highlights very small snippets of the previous code: The root problem is the code in the tutorial is not the code on the sample app, they are out-of-sync copies. |
Fixed by #9982 and playframework/play-samples#83 |
You are not wrong @mkurz. :-) |
Play Version
2.8.x
API
nop
Operating System
linux
JDK
java version "12.0.1" 2019-04-16
Java(TM) SE Runtime Environment (build 12.0.1+12)
Java HotSpot(TM) 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)
Library Dependencies
nop
Expected Behavior
Actual Behavior
comes out the error:
The text was updated successfully, but these errors were encountered: