본문 바로가기

play framework2

Playframework 2.4.x 에서 Intellij 프로젝트 import 할 때~!! object index is not a member of package views.html Ok(views.html.index("Your new application is ready.")) 위와 같은 에러가 발생 할 때 target/scala-2.11/twirl/main 를 추가해보자 더보기
[Play Framework] Scala Test 1. Test 폴더에 Scala 테스트 클래스를 작성한다. 2. 관련 라이브러리 importimport play.api.test._ import play.api.test.Helpers._ 3. Application 상황에서 테스트를 하고 싶다면val fakeApplicationWithGlobal = FakeApplication(withGlobal = Some(new GlobalSettings() { override def onStart(app: Application) { println("Hello world!") } })) 4. 테스트 Object 작성object ExamplePlaySpecificationSpec extends PlaySpecification { "The specification" sh.. 더보기
[Play Framework] Scala에 Hibernate + Jasypt 적용하기 1. 라이브러리 추가(http://www.jasypt.org/hibernate.html)"org.jasypt" % "jasypt-hibernate4" % "1.9.2"2. 초기값 설정class ApplicationLoader extends GuiceApplicationLoader { override def builder (context: ApplicationLoader.Context) : GuiceApplicationBuilder = { val stringEncryptor = new StandardPBEStringEncryptor() stringEncryptor.setPassword("asdfweqfqwef")//아무거나.. HibernatePBEEncryptorRegistry .getInstance().. 더보기
[Play Framework] Request Handler 처리 방법 Play Framework 2.4버전 처리 방법이다 (https://www.playframework.com/documentation/2.4.x/ScalaHttpRequestHandlers) import javax.inject.Inject import play.api.http._ import play.api.mvc._ import play.api.routing.Router class SimpleHttpRequestHandler @Inject() (router: Router) extends HttpRequestHandler { def handlerForRequest(request: RequestHeader) = { router.routes.lift(request) match { case Some(handle.. 더보기
typesafe activator 삭제하기 .ivy2 폴더와 .activator 폴더를 삭제하면 된다. 더보기