I made this way more confusing than it needed to be. Here is the simplified version.
1 - I have a drop down and a submit button on every page in the upper right hand corner. The drop down is a list of languages. The user can change the language and press the submit button to go to the language controller and update the current language.
public class LanguageController {
@ModelAttribute("languageList")
public LanguageList populateLanguageList() {
return LanguageDAO.all();
}
@RequestMapping("/setLanguage.mvc")
public ModelAndView setLanguage(
@ModelAttribute("languageForm") LanguageForm languageForm,
HttpServletRequest request,
HttpServletResponse response
){
//do stuff
}
}
<form:form modelAttribute="languageForm">
<form:select path="acctGrpId" >
<form:options items="${languageList}"/>
</form:select>
<input type="submit"/>
</form:form>
How would I make that available on every page? Given that the page might be a page where you are editing/creating a user so the "Controller" of that page is actually a UserController, or RoleController, or DepartmentController, not the LanguageController. I need this particular jsp to hit a specific controller regardless of what the page is doing.