0

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
    }

1 Answer 1

2
compact(render(decompose(division)))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.