How to get resource from spring mvc controller to java script html?

I have got controller like this (Spring 5 mvc):

package com.hellokoding.springboot;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

public class HelloController {
    public String hello(Model model, @RequestParam(value="name", required=false, defaultValue="World") String name) {
        model.addAttribute("name", name);
        return "hello";

And hello.jsp like this:

<!DOCTYPE html>

<html lang="en">
    <meta charset="UTF-8">
    Hello ${name}

Everything is fine, but right now I would like to have this "${name}" not in HTML, but in Java Script. Something like:

<script language="javascript" type="text/javascript">
    var nameInJavaScript = ${name};

Generally the question is very simple is it possible to handle attribute from java spring controller in this case "name" into Java Script? I think that there is some possibility. Could someone tell me how to code it? This code resources has been taken from: