Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can not import filters in playframework 2.3.0

I use playframework 2.3.0, recently I want to add the CSRFFilter

when I import csrf in global.scala:

import play.filters.csrf._

I get an error for this:

[error] G:\testprojects\app\Global.scala:7: object filters is not a member of package play [error] import play.filters.csrf._

My plugin.sbt is

...
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.0")
...

I use Build.scala instead of build.sbt

lazy val root  = Project("root", base = file(".")).enablePlugins(PlayScala)
.settings(baseSettings: _*)
.settings(libraryDependencies++=appDependencies)
.settings(
  scalaVersion := "2.11.1",
  version := "1.0"

)
like image 343
user504909 Avatar asked Jun 17 '14 06:06

user504909


1 Answers

According to the documentation you have to add the filters dependency to your project:

libraryDependencies += filters

The documentation is for build.sbt but I guess it should work with Build.scala too.

like image 164
Christian Avatar answered Oct 29 '22 18:10

Christian