Reputation: 369
I used the build in validation in play framework to validate the name using validation.match, but it throws an "identifier expected but 'match' found"
package controllers
import play.*
import play.mvc.*
import play.data.validation.Validation
object Application extends Controller {
def adduser = {
val name = params.get("name")
validation.match(name, "[A-Za-z ]+").message("Please enter valid name")
}
}
Upvotes: 0
Views: 786
Reputation: 4194
I believe you intend to use the "matches" function that the String type provides. 'match' itself is a reserved word, which is why the compiler is complaining.
Upvotes: 3