H
H
heilagr_weyland2018-02-10 13:20:36
JavaScript
heilagr_weyland, 2018-02-10 13:20:36

Process a JSON string so that Javascript can work with it as an array, and what is the best way to pass this string to index.html using Spring MVC?

I tried this, but I don't know how to get it and process it in JS

@GetMapping("/")
    public ModelAndView index() {
        ParseTask parseTask = new ParseTask();
        Map<String, String> model = new HashMap<>();
        model.put("name", parseTask.toArray() );
        return new ModelAndView("index", model);
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yerlan Ibraev, 2018-02-12
@mad_nazgul

Read about @RestController ?!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question