spring mvc - Signature of Methods Returning ModelAndView and Request Mapping by Method Name -


two beginner springmvc questions:

1) there required signature types in springmvc modelandview-returning methods, or it's free-form, whatever params/order want? i've seen these examples:

public modelandview action1(httpservletrequest request); public modelandview action2(model m); public modelandview action2(httpservletrequest request, model m); public modelandview action4(); //etc. 

2) possible have requestmapping method name, not whole url? have url, /test, can either /test?method=action1 or /test?method=action2 (similar struts).

@requestmapping("/test?method=action1") public modelandview action1(model m) { //... } 


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -