changeset 103 | bd6e45c7aa8d |
child 105 | 40c51038c9e4 |
102:8f2c3329c9b8 | 103:bd6e45c7aa8d |
---|---|
1 package controllers |
|
2 |
|
3 import play.api.mvc._ |
|
4 |
|
5 // hello world program: |
|
6 // just answer the GET request with a string |
|
7 |
|
8 object Application extends Controller { |
|
9 |
|
10 // answering a GET request |
|
11 val index = Action { request => |
|
12 |
|
13 Ok("Hello world!") |
|
14 } |
|
15 |
|
16 } |
|
17 |
|
18 /* |
|
19 * HTML can be returned using |
|
20 * |
|
21 * Ok("<H1>Hello world!</H1>").as(HTML) |
|
22 * |
|
23 */ |