title: How to get value from a ModelAndView object in jsp Page?
body: <p>For eg:i use a method in controller class : </p>
  
  <pre><code>public ModelAndView fileupload(HttpServletRequest request, HttpServletResponse response) throws Exception
  </code></pre>
  
  <p>Within that method i use </p>
  
  <pre><code>Map modelMap = new HashMap();
  </code></pre>
  
  <p>Then set the value like </p>
  
  <pre><code>modelMap.put(name,request.getParameter("uname")); 
  </code></pre>
  
  <p>Then in modelView object I add the object like </p>
  
  <pre><code>modelView.addAllObjects(modelMap); 
  </code></pre>
  
  <p>Then set the view like </p>
  
  <pre><code>modelView.setViewName("salu.jsp");
  </code></pre>
  
  <p>then returned modelView object.</p>
  
  <p>It is displaying that jsp page but the value I print in jsp using the scriptlet like</p>
  
  <pre><code>&lt;% String username=request.getAttribute("name"); 
     out.println("name is  "+username); %&gt;.
  </code></pre>
  
  <p>But it is printing the value is null. Tell me how i can get thet Value.</p>