Model.SetViewName in Spring -
i know addobject here. can please tell me modelandview.setviewname("vendorinfo");
sorry beginner
@requestmapping(value = "/listsupplier",method = requestmethod.get) public modelandview supplierlist() { list<supplier> supplierlist=adminservice.listsuppliers(); modelandview.setviewname("vendorinfo"); modelandview.addobject("supplierslist", supplierlist); return modelandview; }
it sets name of view resolved configured viewresolver
. let's view in /web-inf/views/vendorinfo.jsp
, view resolver configured prefix /web-inf/views/
, suffix .jsp
, view resolver know use prefix + viewname + suffix
view rendered.
Comments
Post a Comment