I'm trying to convert our most complicated spring 2 controller to spring 3 with annotations. This controller has a ton of reference data, and some of it needs a loaded model to do its thing.
The issue I'm having is that once a referenceData style method includes the model as a parameter, the method for that model is no longer called.
Here are some snippets:
I'm pretty sure I'm not doing this the right way, but the documentation is light on information. Is it possible to have a 'referenceData' method use the form backing object? If so, how?Code:// reference data @ModelAttribute("packages") public List<StretchPackage> getPackages(@ModelAttribute("eventModelObj") EventModel model){ return packageDao.getForUser(model.getClientId()); } // form backing object // This is invoked when getPackages does NOT have the model passed to it // If i remove it from getPackages(), or rename it to @ModelAttribute("eventModelObj111") it is invoked @ModelAttribute("eventModelObj") public EventModel formBackingObject(HttpServletRequest request){ EventModel model = new EventModel(); // do lots of stuff return model; }


Reply With Quote
