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

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -