- Your first Play application
- 日常茶飯事
- 2013. 7. 27. 02:46
http://www.playframework.com/documentation/2.1.x/JavaTodoList
Play 2.1.2
아주 간단한 예제
There is no need to compile the code yourself or restart the server to see the modification. It is automatically reloaded when a change is detected.
- 라우팅 추가
conf/routes
- Task 모델
- 템플릿 수정
index.scala.html
- Rendering the first page
- form 전송 처리 - 데이터베이스 처리
conf/application
EBean (Play’s default ORM) 사용
- 삭제 기능
- Heroku에 배포
...다음 기회에
Play 2.1.2
아주 간단한 예제
> play new todolist //프로젝트 생성
> cd todolist
> play
[todolist] $ run
> cd todolist
> play
[todolist] $ run
There is no need to compile the code yourself or restart the server to see the modification. It is automatically reloaded when a change is detected.
- 라우팅 추가
conf/routes
# Home page
GET / controllers.Application.index()
# Tasks
GET /tasks controllers.Application.tasks()
POST /tasks controllers.Application.newTask()
POST /tasks/:id/delete controllers.Application.deleteTask(id: Long)
GET / controllers.Application.index()
# Tasks
GET /tasks controllers.Application.tasks()
POST /tasks controllers.Application.newTask()
POST /tasks/:id/delete controllers.Application.deleteTask(id: Long)
- Task 모델
- 템플릿 수정
index.scala.html
- Rendering the first page
- form 전송 처리 - 데이터베이스 처리
conf/application
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play"
...
ebean.default="models.*"
서버 재시작할 필요없음.db.default.url="jdbc:h2:mem:play"
...
ebean.default="models.*"
EBean (Play’s default ORM) 사용
- 삭제 기능
- Heroku에 배포
...다음 기회에
Recent comment