a question about Spring controller -
a piece of code this:
@controller public class homecontroller { public static final int default_spittles_per_page = 25; private spitterservice spitterservice; @inject public homecontroller(spitterservice spitterservice) { this.spitterservice = spitterservice; } @requestmapping({"/","/home"}) public string showhomepage(map<string, object> model) { model.put("spittles", spitterservice.getrecentspittles(default_spittles_per_page)); return "home"; } }
i confused servlet know pass method? in example pass map model showhomepage, want know model , contains in model?
the method not need pass model view, servlet implicitly pass argument model view?
you should study the extended spring documentation on @requestmapping
it explains string returned method interpreted view name, , map passed argument serve enrich model passed view
cheers
grooveek
Comments
Post a Comment