相关疑难解决方法(0)

在portlet中设置SearchContainer以使用EL和JSTL在JSP中使用它

我想SearchContainer在我的liferay应用程序中使用.目前我要使用JSP Scriplets 在标签中设置结果<liferay-ui:search-container-results>.这是到目前为止的片段:

<liferay-ui:search-container emptyResultsMessage="there-are-no-courses" delta="5">
    <liferay-ui:search-container-results>
        <%
            List<Course> tempResults = ActionUtil.getCourses(renderRequest);

            results = ListUtil.subList(tempResults, 
                                   searchContainer.getStart(), 
                                   searchContainer.getEnd());

            total = tempResults.size();
            pageContext.setAttribute("results", results);
            pageContext.setAttribute("total", total);
        %>
    </liferay-ui:search-container-results>

    <liferay-ui:search-container-row ...></liferay-ui:search-container-row>

    <liferay-ui:search-iterator />

</liferay-ui:search-container>
Run Code Online (Sandbox Code Playgroud)

现在,我想将这些划线改为EL.我发现了一篇关于同一问题的帖子,但那是在使用Spring MVC.而且我不知道在portlet中,在该问题的答案中给出了下面这一行:

SearchContainer<Book> searchContainer = new SearchContainer<Book>(renderRequest, renderResponse.createRenderURL(), null, "there are no books");
Run Code Online (Sandbox Code Playgroud)

在我的portlet操作中无法写入它,因为我的操作中的参数是ActionRequestActionResponse,它没有定义方法createRenderURL().我怎么会得到的PortletURL

我应该在哪里写上述声明?目前我正在写同一个动作,我将返回此页面.我做得对吗?这是我从同一页面触发的动作,如下所示search-container:

public void addCourse(ActionRequest request, ActionResponse response) 
        throws Exception {

    ThemeDisplay themeDisplay = 
            (ThemeDisplay) …
Run Code Online (Sandbox Code Playgroud)

java jsp portlet jstl liferay

6
推荐指数
1
解决办法
1773
查看次数

标签 统计

java ×1

jsp ×1

jstl ×1

liferay ×1

portlet ×1