这是我的代码,这里的返回类型是列表,但列表转换为数组,返回类型更改为字符串
@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
}
我试过了,但这不起作用
返回类型将List更改为String并将值更改为List到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
}