You must annotate your Controller's methods with @ActionMapping/@RenderMapping tags in the way it follows
Code:
@RequestMapping(value="VIEW")
@Controller(value="myController")
public class MyController {
...
@ActionMapping(params="action")
public void actionDispatcher(@RequestParam("action") String action,
@ModelAttribute("estadoPedido") EstadoPedidoForm form,
BindingResult bindingResult, Model model,
ActionRequest aRequest, ActionResponse aResponse){
//your code goes here
}
@RenderMapping(params="action")
public String renderDispatcher(@RequestParam("action") String action){
String retorno = null;
if (action.equals("consultar") || action.equals("return")){
retorno = "consultaPedido";
}else if(action.equals("irDetallePedido")){
retorno = "detallePedido";
}else if (action.equals("noDisponible")) {
retorno = "noDisponible";
}else if(action.equals("error")){
retorno = "error";
}
return retorno;
}
}
No matters your method's names, they will be executed when a Action/Render request is recived and matches with their requirements (i.e. request with a param called "action", or it could be more restrictive: a param called action which value is "doSomething"... etc)
in this example, both methods acts as dispatchers, doing one or another thing depending on the action parameter value.
Here you are 2 very instructive links:
http://books.dzone.com/articles/hell...-3-portlet-MVC
http://books.dzone.com/articles/spri...let-mvc-part-2
I hope it could helps you some.