RequestMapping渲染方法

RequestMapping渲染方法

本文介绍了在2 PARAMS @RequestMapping渲染方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图来管理同一个控制器2的行动,一切都OK!唯一的一点是doRender方法。
我试图用同样的方法呈现两个动作,是这样的:

 私有静态最后弦乐ACTION_ALTA_TIPO_FACTURA =行动=+ ServletContextKeys.SC_ALTA_TIPO_FACTURA;
私有静态最后弦乐ACTION_BAJA_TIPO_FACTURA =行动=+ ServletContextKeys.SC_BAJA_TIPO_FACTURA;@RequestMapping(PARAMS = {ACTION_BAJA_TIPO_FACTURA,ACTION_ALTA_TIPO_FACTURA})
公共最后弦乐doRender(@ModelAttribute(值=Factura)F​​actura justfactura,错误错误的RenderRequest的RenderRequest){
        ...
}

但显然这不工作。这是服务器日志这样说:

<$p$p><$c$c>[#|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:未找到portlet请求匹配处理方法:模式观看,阶段RENDER_PHASE',参数映射['行动' - &GT;阵列下;字符串&GT; ['altaFactura'],'altaFactura_tabs' - &GT;阵列&LT;串GT; ['factura']; _ =请求ID 7ffe667a-23c0-4599-b1f6-0a53d11a5cb7; | PSPL_PCCSPCPCI0001:异常来自ENTITYID抛出:sifo3economicoweb | SifoIIIweb | SifoIIIweb_WAR_sifo3economicoweb_INSTANCE_fu7M,原因:org.springframework.web.portlet.NoHandlerFoundException:无匹配处理方法找到了portlet请求:模式观看,阶段RENDER_PHASE',参数映射['行动' - &GT;阵列下;字符串&GT; ['altaFactura'],'altaFactura_tabs' - &GT;阵列下;字符串&GT; ['factura']] |#]

任何帮助,请??


解决方案

要做到这一点的唯一方法是定义多个方法。

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??

解决方案

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

这篇关于在2 PARAMS @RequestMapping渲染方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 13:18