title: How do I set up a Spring MVC view resolver for a javascript resource?
body: <p><strong>I generate javascript using a Spring MVC controller as follows:</strong> </p>
  
  <pre><code>@RequestMapping(value="path/to/handler", method = RequestMethod.GET, produces ="text/javascript")
  public ModelAndView getJs(HttpServletRequest request) {
    String contextPath = request.getContextPath();
    return new ModelAndView("/path/to/js/", "contextPath", contextPath);
  }
  </code></pre>
  
  <p>I am not sure how to set up the view resolver for the javascript resource though. Can someone please advise how to set up the view resolver for a js resource?</p>