title: How do I access ModelMap in a jsp?
body: <p>How can an object be accessed from the ModelMap in jsp so that a method can be called on it? Currently I recieve this error: </p>
  
  <pre><code>Syntax error on token "$", delete this token
  </code></pre>
  
  <p>JSP</p>
  
  <pre><code>&lt;body&gt;
          &lt;% MenuWriter m = ${data.menus} %&gt;
          &lt;%= m.getMenus()%&gt;  
  &lt;/body&gt;
  </code></pre>
  
  <p>Java</p>
  
  <pre><code>@Controller
  @RequestMapping("/dashboard.htm")
  @SessionAttributes("data")
  public class DashBoardController {
  
      @RequestMapping(method = RequestMethod.GET)
      public String getPage(ModelMap model) {
          String[] menus = { "user", "auth", "menu items", };
          String[] files = { "menu", "item", "files", };
          MenuWriter m = new MenuWriter(menus, files);
          model.addAttribute("menus", m);
  
          String[] atocs = { "array", "of", "String" };
          model.addAttribute("user_atocs", atocs);
  
          return "dashboard"; 
      }
  }
  </code></pre>