我是 Play 2 和 Scala 的新手,我的模板中出现了一个奇怪的异常:
Execution exception
-------------------
[NoSuchElementException: None.get]
In /home/nic/workspaces/scala-ide/scims/app/views/persons/detailTabs/personal.scala.html at line 4.
1. @(personId: Long, personDetailTabForm: Form[dto.PersonDetailTab])(implicit formOptions: dto.PersonFormOptions)
2. @implicitFieldConstructor = @{ helper.FieldConstructor(support.bs3HorizField.f) }
3.
4. @persons.detail("personal", personDetailTabForm.get.firstName) {
personDetailTabForm 是一个空的表单对象,定义为:
val personalDetailTabForm: Form[PersonDetailTab] = Form(
mapping(
"firstName" -> text.verifying(nonEmpty),
"middleName" -> text,
"lastName" -> text.verifying(nonEmpty),
"gender" -> text,
"dateOfBirth" -> jodaDate("yyyy-MM-dd"),
"ethnicity" -> text,
"maritalStatus" -> text,
"password" -> text
)(PersonDetailTab.apply)(PersonDetailTab.unapply)
)
关于这里有什么问题的任何想法?
我的印象是一个变量必须是一个选项才能获得一个无?
干杯 NFV