Unable to display the list in jsp page

164 views Asked by At

I am using a controller to display a simple list of string in html page. I am not getting any error, however while launching the page, it is downloading the list of json object and asking me to save it as a file. please help me where to give so that it can display it in the jsp page.

here is my controller.

@Controller
@RequestMapping(value="/hello")
public class HelloWorldController {

     public static Map<String, UserForm> data = new HashMap<String, UserForm>();
      static{
        data.put("ADAM", new UserForm("Adam", "Santharam", 30));
        data.put("JANE", new UserForm("Jane", "Babu", 27));
      }


    @RequestMapping(value="{name}", method = RequestMethod.GET, produces="application/json")
    public @ResponseBody UserForm getTestJson(@PathVariable String name) {          

        UserForm user = data.get(name.toUpperCase());

        //UserForm user = new UserForm("Rengaram", name, 1001);
        return user;
    }

}
0

There are 0 answers