Skip to content

Instantly share code, notes, and snippets.

@maiha
Created May 3, 2010 22:21
Show Gist options
  • Save maiha/388654 to your computer and use it in GitHub Desktop.
Save maiha/388654 to your computer and use it in GitHub Desktop.
// http://www.playframework.org/documentation/1.1-trunk/firstapp
package controllers
import play.mvc._
import play.data.validation._ // @Required
object Hello extends Controller {
def index = render()
def sayHello(@Required myName: String) {
if(validation.hasErrors()) {
flash.error("Oops, plase enter your name!")
index
}
render(myName)
}
}
Compilation error (In /app/controllers/Hello.scala around line 15)
The file /app/controllers/Hello.scala could not be compiled. Error raised is : value hasErrors is not a member of play.data.validation.Validation
play.exceptions.CompilationException: value hasErrors is not a member of play.data.validation.Validation
at play.scalasupport.core.ScalaPlugin$ScalaCompiler$$anon$1.info0(ScalaPlugin.scala:153)
at play.scalasupport.core.ScalaPlugin$ScalaCompiler.compile(ScalaPlugin.scala:257)
at play.scalasupport.core.ScalaPlugin.compile(ScalaPlugin.scala:141)
at play.scalasupport.core.ScalaPlugin.onClassesChange(ScalaPlugin.scala:125)
at play.classloading.ApplicationClassloader.detectChanges(ApplicationClassloader.java:249)
at play.Play.detectChanges(Play.java:476)
at play.Invoker$Invocation.init(Invoker.java:98)
at Invocation.HTTP Request(Play!)
Scala: 2.8.0.RC1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_15)
Play: play-1.1-unstable-r881
module: scala-0.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment