简体   繁体   中英

Liferay inter portlet communication

I'm sorry if this is a stupid question, however after hours of research, I was unable to find a solution to my two issues:

  1. Communication between portlets on the same page (using jsr286 , public render parameter). The main problem here is using AJAX for the IPC , so that the communication stays server-side, but the page doesn't refresh.
  2. The second problem I have is, how do I redirect from the first to a second jsp page, while passing a variable back end to the java file of the portlet on the second page?

Any help is appreciated, thanks in advance!

Ad. 1 Have you tried following document explaining idea of IPC Mechanism? (second section of document)

http://www.liferay.com/community/wiki/-/wiki/Main/Portlet+to+Portlet+Communication

Basically idea is pretty simple and I have created some portlets using it back then.

Ad. 2 Correct me if I am wrong, as I understand, you want to pass some parameters while redirection? Well, just pass these parameters to response object in method invoking redirection and you will be able to receive them in your second method. Here is part of code passing some parameters from Action phase to Render phase which is responsible for presenting view result.

    response.setRenderParameter(CURRENT_PAGE_PARAM, currentPage);
    response.setRenderParameter(DELTA_PARAM, deltaParam);
    response.setRenderParameter(ACTION_PARAM, "filterData");

Another idea can be storing your information in session model if this is shared between multiple views.

For anyone who is looking for good examples of Liferay portlets, check out this great GitHub repository !

Helped me with my problems out a lot!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM