Search code examples
springpaginationportletdisplaytag

Spring MVC Portlets: external pagination with displaytag needs to go to the action phase


I'm using Spring MVC portlets I need to implement one display tag with external pagination. In order to do this, I've defined my table in the JSP like this:

    <portlet:actionURL var="viewListURL">
        <portlet:param name='action' value='${ServletContextKeys.MY_ACTION_METHOD}'/> 
    </portlet:actionURL>  
                <display:table name="${whateverList}"
                               requestURI="${viewListURL}"
                               class="displayTagTable"
                               export="true"
                               uid="item"
                               pagesize="10"
                               partialList="true"
                               sort="external"
                               defaultsort="1"                                  
                               size="${ServletContextKeys.SC_LIST_SIZE}">
     ...

The problem is that, when I click any button to paginate, the displaytag redirects me to the render phase instead the action phase as I want to. What am I doing wrong? Any ideas..? Thanks a lot

EDIT: I can see in the URL that the parameter p_p_url_type=0 (render phase). it makes no sense to me, as I'm calling an action url, but maybe would be enough just change this parameter to p_p_url_type=1. But, I'm just don't know how... Any ideas?

http://localhost:8080/wsdes/user/sifo3/home?p_p_id=SifoIIIweb_WAR_sifo3economicoweb_INSTANCE_s8jH&p_p_lifecycle=1&p_p_url_type=0&p_p_state=maximized&p_p_mode=view&_SifoIIIweb_WAR_sifo3economicoweb_INSTANCE_s8jH_action=consultaJustificantes&_SifoIIIweb_WAR_sifo3economicoweb_INSTANCE_s8jH_implicitModel=true&_SifoIIIweb_WAR_sifo3economicoweb_INSTANCE_s8jH_d-49489-p=2

Solution

  • I still don't know the reason, but I fixed this issue changing the display tag for Portlets (displaytag-portlet.jar), to the standard displaytag, and deleting from the displaytag.properties file the factory.requestHelper property: factory.requestHelper=org.displaytag.portlet.PortletRequestHelperFactory

    Using the normal displaytag library, instead of the portlet one, fixed my problems.