just curious know in scenario should go @requestparam , @pathvariable. know that:
@requestparamtakes parameter value whereas@pathvariabletakes placeholder value@requestparamcan optional (required=false) while making request whereas@pathvariablevalue has provided.- when want use
@requestparamhave know property syntax@pathvariablenot required
is there other reason go specific one?
use @pathvariable if want adhere 'statefull' urls.
for example:-
/customer/:id customer view/edit page /customer/ customer add page /customer/list list customer page /customer/:cid/order order of customer /customer/:cid/order/:oid specific order of partucular customer. wisely using path variable result in url gives hint/clue resulting view/page means.
this lets support refresh,back & forward operation no effort.
@requestparams can used exatract data not passed path params. mvc handler can have combination of 2 required.
Comments
Post a Comment