title: How to access Model Attribute's value and set to ModelAndView
body: <p>I cant seem to find the solution for this.</p>
  <p>I have method that returns ModelAndView to view web pages.</p>
  <p>I store a webpage filename to model whenever a condition is true.</p>
  <p>Example:</p>
  <pre><code>    @RequestMapping(value = &quot;/process&quot;, method = RequestMethod.POST)
      public ModelAndView processRequest(HttpServletRequest request,
      HttpServletRequest response, Model model,@RequestParam(&quot;file&quot;) MultipartFile file) 
      throws IOException {
          
          if (file.isEmpty()) {
               model.addAttribute(&quot;exception&quot;, &quot;web_file1&quot;)
          } else {
               model.addAttribute(&quot;exception&quot;, &quot;web_file2&quot;)
          }
            
              
  </code></pre>
  <p>How can I retrieve the data stored in &quot;exception&quot; and set it to ModelAndView?</p>
  <pre><code>                ModelAndView mav = new ModelAndView();
                  mav.setViewName(&quot;exception&quot;);  
                  //expected:web_file2 
                  //actual:exception
                  return mav;
          
  </code></pre>