Reputation: 4174
This is my code and here the return type is list but the list convert to array and the return type change to string
@RequestMapping(value =Array( "/StandardChange.html"))
@ResponseBody
def findDivisionOfStandards(@RequestParam divisionid:Long):List[Division] ={
var division:List[Division]= null
if (divisionid != null) {
division = divisionService.findDivisionByStandardId(divisionid)
}
division
}
I tried this but this is not working
the Return type change List to String and the value change to List to Json Array
@RequestMapping(value =Array( "/StandardChange.html"))
@ResponseBody
def findDivisionOfStandards(@RequestParam divisionid:Long):String ={
var division:List[Division]= null
if (divisionid != null) {
division = divisionService.findDivisionByStandardId(divisionid)
}
var divisionjsonArray= division.toArray **json convert should be here**
divisionjsonArray
}
Upvotes: 0
Views: 1651