Here i use to concatenate 2 Lists (with same type) using this :+
and the code is testResult :+ studentsearch
the length of the list get value zero in the console
Controller
@RequestMapping(value = Array("parent/ViewReports.html"))
def viewReportPage(test: Test): String = {
var userAccount: UserAccount = secService.getLoggedUserAccount
var z = userAccount.getId().toLong
var studentsearch: java.util.List[StudentTest] = Nil
var studentTestResult: java.util.List[StudentTest] =Nil
var testResult: java.util.List[StudentTest] =Nil
var searchstudent = parentStudentService.findParentStudentByParent(z)
for(srchStd <- searchstudent){
var sid= srchStd.getStudent().getId()
studentsearch = studentTestService.findAllStudentTestByStudent(sid)
}
testResult :+ studentsearch
println("Length:" +testResult.length)
studentTestResult = ListBuffer(testResult: _*) .
results = studentTestResult
"redirect:/parent/result.html"
}
the concatenate code is wrong ?
please share your answers