The next example Spring 4 Scala MVC without Web.XML with Apache Tiles3 runs on Tomcat7 using Java Servlet 3.x but before we need to configure SBT to provide us such functionality:
1. configure project build.sbt file in following example way
libraryDependencies ++= Seq(
"org.springframework" % "spring-webmvc" % "4.0.6.RELEASE",
"org.springframework" % "spring-context" % "4.0.6.RELEASE",
"org.springframework" % "spring-context-support" % "4.0.6.RELEASE",
"org.apache.tiles" % "tiles-jsp" % "3.0.4",
"javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided",
"javax.servlet" % "jstl" % "1.2" % "compile",
"org.slf4j" % "jcl-over-slf4j" % "1.7.5" ,
"org.slf4j" % "slf4j-api" % "1.7.5" ,
"org.slf4j" % "slf4j-log4j12" % "1.7.5",
"log4j" % "log4j" % "1.2.17" excludeAll(
ExclusionRule(organization = "com.sun.jdmk"),
ExclusionRule(organization = "com.sun.jmx"),
ExclusionRule(organization = "javax.jms")
),
"org.apache.tomcat.embed"% "tomcat-embed-core"% "7.0.40"% "container",
"org.apache.tomcat.embed"% "tomcat-embed-logging-juli"% "7.0.40"% "container",
"org.apache.tomcat.embed"% "tomcat-embed-jasper"% "7.0.40"% "container"
)
tomcat(port = 9090)
important part is about tomcat related libraries which allow us:2. by having running sbt such configuration makes possible to use following command
container:startstopping server is by exchanging word after :
Enjoy SBT Tomcat 7 development !
project: miko-spring-scala on github
No comments:
Post a Comment