title: Master Page for Nav Menu - Partial Views with Spring MVC?
body: <p>I'm using spring mvc 3.2.2.  I have a main index page that contains a header for login/user info as well as a navigation menu and a footer (as well as it's own content).</p>
  
  <pre><code>&gt; http://localhost:8080/mywebsite/home/index.jsp
  
  &lt;html&gt;....
  &lt;head&gt;...
  &lt;body&gt;
     &lt;headerbar&gt;...
     &lt;navmenu&gt;...
     &lt;!-- Content here....--&gt;
     &lt;footer&gt;
  &lt;body&gt;
  </code></pre>
  
  <p>Now that I will be adding new controllers and actions how can I reuse the header/nav menu and footer so that I don't have to add it in each additional page?</p>
  
  <p>So for my users controller page all I want to have to do is render the user information without having include the header/nav/footer etc.</p>
  
  <pre><code>&gt; http://localhost:8080/mysite/account/user/8585
  
  &lt;!-- Only include the following but have it render as body() where nav menu/footer/header are already included in some partial view or master page --&gt;
  &lt;h4&gt;User Account&lt;/h2&gt;
  &lt;user&gt;${username}&lt;/user&gt;
  &lt;firstname&gt;${firstname}&lt;/firstname&gt;
  </code></pre>
  
  <p>How can I accomplish this?</p>
  
  <pre><code>&lt;html&gt;....
  &lt;head&gt;...
  &lt;body&gt;
     &lt;headerbar&gt;...
     &lt;navmenu&gt;...
       RenderBody?() &lt;!-- Content here from any page include home/index.jsp and account/user....--&gt;
     &lt;footer&gt;
  &lt;body&gt;
  </code></pre>