Struts portlet life cycle and developping rules

3663413, modified 16 Years ago. Junior Member Posts: 29 Join Date: 7/28/09 Recent Posts
hello! I am having some doubts about developing principles or basic rules for developping portlets and I am sure that your view will help me a lot.

We are using struts for our developments, and to start we use the sample struts portlets that we can find in the liferay wiki.

There are 2 samples for struts 1.x with a big difference. Sample-struts-portlet's actions extends from org.apache.struts.action.Action and implement the execute method. In the other side, Sample-struts-liferay-portlet's actions extends from com.liferay.portal.struts.PortletAction which extends from org.apache.struts.action.Action, but they implement the processAction and render methods. Which example should I use to start my development?

I have been using the first aproach, because it is not so dependant of liferay (it doest not use liferay imports, only struts's), but I think that this way I am not really following the jsr-168 or 268 scpecification or the portlet life cycle, right? and then it is not easy to use some portlet functionalities as the inter portlet communication (for example with events, we are able to listen to events implementing a class extending com.liferay.portlet.StrutsPortlet, but we cant send the variable obtained in the event to the execute method of an action)

Another reason why we have used the first one, and not the second one, is because we dont want to refresh all the portlets in the page every time an action is executed. We are using maps in some portlets and we dont want them to go back to the start position when using neighbour portlets. Is it really required to refresh all the portlets in the page to follow the jsr-168 specification everytime an action is executed? I dont really understand why this is done...

what aproach are you using??

Thank you!
4752313, modified 16 Years ago. New Member Post: 1 Join Date: 3/23/10 Recent Posts
Hello,

I'd like to know if anyone ever came up with a solution to the "refreshing the entire page every time an action is executed" problem, mentioned in the post above.

I know this is an old post, but I am just getting started with Liferay, so most posts are new to me, and I think they may be new to others as well. So, if anyone knows how to fix this issue, please share the solution!

Thank you.
thumbnail
11255, modified 16 Years ago. Liferay Master Posts: 581 Join Date: 6/21/06 Recent Posts
Joaquin Rg u:
Is it really required to refresh all the portlets in the page to follow the jsr-168 specification everytime an action is executed? I dont really understand why this is done...


I believe so. If you send in an ActionRequest (or RenderRequest), the whole page refreshes. Otherwise, you can send in an AJAX request and that wouldn't refresh the page.