2
我已经拥有很多的渲染和操作方法的portlet:这应该引起Liferay的门户不是要求正确的渲染方法(忽略的setRenderParameter)
@Controller
@RequestMapping("VIEW")
public class CartController {
@RenderMapping() // default render method
public String defaultRender(RenderRequest req, RenderResponse res, Model model) throws PortalException, SystemException {
...
}
@RenderMapping(params="action=showCustInfo")
public String showCustInfo(RenderRequest req, RenderResponse res, Model model) throws PortalException, SystemException {
...
}
@ActionMapping(params="action=acceptCart")
public void acceptCart(ActionRequest req, ActionResponse res, Model model) throws PortalException, SystemException {
...
res.setRenderParameter("action", "showCustInfo");
...
}
在上面的代码中,方法acceptCart将呈现参数showCustInfo在渲染阶段被调用。
问题是每次都会调用默认的渲染方法。我错过了什么?