Skip to content

Instantly share code, notes, and snippets.

@ovstetun
Created February 17, 2010 10:15
Show Gist options
  • Save ovstetun/306485 to your computer and use it in GitHub Desktop.
Save ovstetun/306485 to your computer and use it in GitHub Desktop.
package test;
@Controller
@RequestMapping("/person/{id}/overview")
public class MyController {
...
@ModelAttribute
public Person getPerson(@PathVariable final long id, final HttpServletRequest request) {
final Person soknad = personRepository.fetch(id);
return soknad;
}
@ModelAttribute
public PersonOverview getPersonOverview(@PathVariable final long overViewId, final Person person) {
return person.getOverview(overViewId);
}
@RequestMapping(method = RequestMethod.GET)
public String showOverView() {
return "personOverview";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment