1

I'm trying to manage 2 actions in the same controller, and everything's ok! The only thing is the doRender method. I'm trying to use the same render method for both actions, like this:

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's not working. This's 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??

elcadro
  • 1,482
  • 3
  • 21
  • 45
  • could you please add some snippet from your Spring controllers configuration? – Alonso Dominguez Sep 28 '12 at 12:54
  • Apparently, we can't do this... There's a related question here... http://stackoverflow.com/questions/4877250/how-do-i-map-different-values-for-a-parameter-in-the-same-requestmapping-in-spr – elcadro Nov 07 '12 at 11:09

2 Answers2

1

The only way to do this would be defining multiple methods.

elcadro
  • 1,482
  • 3
  • 21
  • 45
1

You can use parameter per method mapping. See my question and answer:

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

Community
  • 1
  • 1
gavenkoa
  • 45,285
  • 19
  • 251
  • 303