2011-04-24 88 views
0

我正在使用grails portlets插件,我试图弄清楚如何路由ajax方法。liferay ajax网址?

<portlet:actionURL>似乎只映射到可以将模型返回给GSP的方法,<portlet:resourceURL>在我的portlet中根本不会被击中。

class MyPortlet { 
    def title = 'MyPortlet' 
    def description = ''' 
     My Portlet 
     ''' 
    def displayName = 'MyPortlet' 
    def supports = ['text/html': ['view']] 

    def liferay_display_category = 'MyPortlet' 
    def liferay_portlet_header_portlet_css = [ 
... 
    ] 

    def liferay_portlet_header_portlet_javascript = [ 
... 
    ] 

    def renderView = { 
     [...] 
    } 

    def actionView = { 
     [...] 
    } 
} 

JS:

this.portletUrl = "${portletResponse.createResourceURL()}";
this.portletUrl = "${portletResponse.createActionURL()}";

如果我打这两种网址与AJAX GETPOST要求的,我要么不打我的方法(resourceURL)或者只能渲染一个视图(actionURL)。

任何想法如何通过liferay正确地做到这一点?

回答

0

使用DWR并且您的问题消失。