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.
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?
Right now I have been using <form:form modelAttribute="classname"...>
with
@RequestMapping(method=RequestMethod.GET)
public String setupForm(Model model) {
model.addAttribute("classnamehere", new ClassNameHere());
return "pagename";
}
Thanks
PS: On a related note, can you automatically include header and footer jsp files throughout a site without doing an <% include
on every page?