@RequestMapping with 2 parameters in the render method

I try to control two actions in one controller, and everything is in order! The only thing the doRender method does. I am trying to use the same rendering method for both actions, for example:

private static final String ACTION_ALTA_TIPO_FACTURA = "action=" + ServletContextKeys.SC_ALTA_TIPO_FACTURA; private static final String ACTION_BAJA_TIPO_FACTURA = "action=" + ServletContextKeys.SC_BAJA_TIPO_FACTURA; @RequestMapping(params = {ACTION_BAJA_TIPO_FACTURA,ACTION_ALTA_TIPO_FACTURA}) public final String doRender(@ModelAttribute(value = "Factura") Factura justfactura, Errors errors, RenderRequest renderrequest) { ... } 

But apparently this does not work. This is what the server log says:

 [#|2012-09-28T11:54:05.723+0000|SEVERE|sun-appserver2.1|debug.com.sun.portal.portletcontainer.impl|_ThreadID=21;_ThreadName=httpSSLWorkerThread-8080-0;sifo3economicoweb|SifoIIIweb|SifoIIIweb_WAR_sifo3economicoweb_INSTANCE_fu7M;org.springframework.web.portlet.NoHandlerFoundException: No matching handler method found for portlet request: mode 'view', phase 'RENDER_PHASE', parameters map['action' -> array<String>['altaFactura'], 'altaFactura_tabs' -> array<String>['factura']];_RequestID=7ffe667a-23c0-4599-b1f6-0a53d11a5cb7;|PSPL_PCCSPCPCI0001 : Exception thrown from EntityID: sifo3economicoweb|SifoIIIweb|SifoIIIweb_WAR_sifo3economicoweb_INSTANCE_fu7M, cause: org.springframework.web.portlet.NoHandlerFoundException: No matching handler method found for portlet request: mode 'view', phase 'RENDER_PHASE', parameters map['action' -> array<String>['altaFactura'], 'altaFactura_tabs' -> array<String>['factura']]|#] 

Any help please?

+1
source share
2 answers

The only way to do this is to define several methods.

+1
source

You can use parameter mapping for each method. See My Question and Answer:

This is archived by classes from the org.springframework.web.servlet.mvc.method.annotation package . * ...

+1
source

All Articles