title: Creating multiple forms in one jsp file. ModelAttributes have to always be set?
body: <p>I am new to Spring and have been reading about it the last few days. I haven't found an open source example like this so far and didn't see a clear way for it to be done.</p>
  
  <p>Many sites have a login or search box that is on every page. If this is the case, how can you avoid setting an attribute in a model on every page for that form? Similarly, if you have a form on page FooBar that should have little knowledge of the processing of the form, which is done in SearchFooBar, how can it create the form without adding the model attribute?</p>
  
  <p>Right now I have been using <code>&lt;form:form modelAttribute="classname"...&gt;</code> with</p>
  
  <pre><code>   @RequestMapping(method=RequestMethod.GET)
      public String setupForm(Model model) {
          model.addAttribute("classnamehere", new ClassNameHere());
          return "pagename";
      }
  </code></pre>
  
  <p>Thanks</p>
  
  <p>PS: On a related note, can you automatically include header and footer jsp files throughout a site without doing an <code>&lt;% include</code> on every page?</p>