scalaã®Webãã¬ã¼ã ã¯ã¼ã¯ liftã§éã¶(2) - ã¤ã³ã¹ãã¼ã«
ç®æ¬¡ã¯ãã¡ãã
scalaのWebフレームワーク liftで遊ぶ 目次 - ゆろよろ日記
ã¾ãã¯scalaã¨liftã®ç°å¢ä½ãã ã?
ã¤ã³ã¹ãã¼ã«ã¯ã¨ã£ã¦ãç°¡åã
scalaã®ãã¦ã³ãã¼ãã»ã¤ã³ã¹ãã¼ã«
ã¾ãã¯ãå®è¡ç°å¢ã§ããscalaã®ã¤ã³ã¹ãã¼ã«ã
Scala Distribution | The Scala Programming Languageãããã¦ã³ãã¼ãããã
è½ã¨ãã¦ããã®ãå®è¡ãã¦ã¤ã³ã¹ãã¼ã«ãåºæ¬çã«å
¨é¨ããã©ã«ãã§OKã
ã¤ã³ã¹ãã¼ã«ããããã³ãã³ãããã³ããããscalaã¨å
¥åããã¨ãscalaã¤ã³ã¿ããªã¿ãèµ·åããã
ããã§ããã¼ã¯ã¼ã«ãã
C:\dev\work>scala Welcome to Scala version 2.7.1.final (Java HotSpot(TM) Client VM, Java 1.6.0_04). Type in expressions to have them evaluated. Type :help for more information. scala> print("Hello,world") Hello,world scala>
ã§ããã
Mavenã®ã¤ã³ã¹ãã¼ã«
liftã§ã¯ãmavenãã´ãªã´ãªä½¿ããrailsã®ããã«ã³ãã³ãã§ããã¸ã§ã¯ãä½ã£ãããjettyç«ã¡ä¸ãããããããã
ãããããMavenãã¤ã³ã¹ãã¼ã«ãã¦ããå¿
è¦ãããã
ãã ããmaven2.0.6以ä¸ã§ã
Mavenã®ã¤ã³ã¹ãã¼ã«ã«ã¤ãã¦ã¯ãã¡ããåç §ã
ããã¸ã§ã¯ãä½æ
ããã
mavenã§liftããã¸ã§ã¯ããä½æããã®ãããã¯wicketã¨ãæè¿ã®ãã¬ã¼ã ã¯ã¼ã¯ã¨åãããªã
mvn archetype:create -U -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic -DarchetypeVersion=0.9 -DremoteRepositories=http://scala-tools.org/repo-releases -DgroupId=com.yuroyoro -DartifactId=hello-lift
ããã§liftããã¸ã§ã¯ããã§ããã
ã§ã次ã«jettyã®èµ·åããããmavenãã
mvn jetty:run -U
ãã¨ã¯http://localhost:8080/ã«ã¢ã¯ã»ã¹ã§OKã
ã§ããã
ãã¼ãRailsã£ã½ãã
Eclipseã§lift
ãåç §ããªããè¨å®ããã
ã¾ããeclipse scala pluginãå°å
¥ããã
[ãã«ã]â[ã½ããã¦ã¨ã¢æ´æ°]â[æ¤ç´¢ããã³ã¤ã³ã¹ãã¼ã«]ã§"ã¤ã³ã¹ãã¼ã«ããæ°è¦ãã£ã¼ãã£ã¼ãé¸æ"â"æ°è¦ãªã¢ã¼ããµã¤ã"ã
åå:scala plugin
URL:http://www.scala-lang.org/downloads/distrib/files/nightly/scala.update/
ã§ã¤ã³ã¹ãã¼ã«ã
次ã«ãmavenããã¸ã§ã¯ãããeclipseããã¸ã§ã¯ããä½æããã
mvn eclipse:eclipse mvn -Declipse.workspace=[maven repository path] eclipse:add-maven-repo
eclipseã®ã¯ã©ã¹ãã¹å¤æ°M2_REPOã«mavenãªãã¸ããªã®ãã¹ãè¨å®ããã
æå¾ã«ãecipseããJettyã®èµ·åè¨å®ãè¡ãã
[å®è¡]â[å®è¡ãã¤ã¢ãã°ãéã]ã§ã"scala application"ãå³ã¯ãªãã¯ãã¦æ°è¦ã®æ§æãä½æããã
ã¡ã¤ã³ã¯ã©ã¹ã«RunWebAppãæå®ããã¨ãeclipseããjettyãèµ·åãã¦ãããã°ã§ããã