liferay ajax urls?

时间:2011-04-24 15:48:37

标签: javascript ajax grails portlet liferay

我正在使用grails portlets插件,我正在试图弄清楚如何路由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)。 / p>

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

1 个答案:

答案 0 :(得分:0)

使用DWR,您的问题就会消失。