Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Rahul Pande
Plugin environment
December 13, 2010 10:43 PM
Answer

Rahul Pande

Rank: Regular Member

Posts: 220

Join Date: July 6, 2010

Recent Posts

Hi all,

I am developing a struts portlet in plugin environment and it is working fine. But the problem is I am confused in creating action class for processing a request. You can create action class by extending either

1. org.apache.struts.action.Action
2. org.apache.portals.bridges.struts.StrutsPortlet

so can anybody tell, in which scenario each class should be used. emoticon




Thank you
Rahul Pande
Alexandre FILLATRE
RE: Plugin environment
December 14, 2010 12:56 AM
Answer

Alexandre FILLATRE

Rank: Junior Member

Posts: 80

Join Date: December 2, 2010

Recent Posts

Hi Rahul,

You'll need to extend the com.liferay.portal.struts.PortletAction class in order to create your portlet. I'd suggest that you download liferay sources, and have a look at how it is done for Liferay portlets. It'll be the same for you.

Regards,
Alexandre FILLATRE
Rahul Pande
RE: Plugin environment
December 14, 2010 10:28 PM
Answer

Rahul Pande

Rank: Regular Member

Posts: 220

Join Date: July 6, 2010

Recent Posts

Thanks Alexandre for the reply ....

But there is one problem the PortletAction class is available in portal-impl.jar. While developing a portlet in plugin ideally you should use portal-kernel.jar and portal-service.jar ONLY and not the implementation classes in portal-impl.jar. If you use those classes, it makes your portlet Liferay dependent.

So I found these two classes that you can use in your action class.

Action class has execute method and StrutsPortlet class has all the methods like doView(), doEdit() etc which are required for any portlet. So do you have any idea on this emoticon




Thanks and Regards,
Rahul Pande
Alexandre FILLATRE
RE: Plugin environment
December 15, 2010 12:35 AM
Answer

Alexandre FILLATRE

Rank: Junior Member

Posts: 80

Join Date: December 2, 2010

Recent Posts

Hi Rahul,

You're totally right. I misread you, I though about portlets in ext environment. For plugins it's different as you said. Although I used to develop struts portlets in ext environment, I always use Spring MVC for plugin portlets.

I'm sorry but then I won't be able to provide you with an answer here. Though I think there is a sample Struts portlet in sourceforge, but the download page is down at the moment.

Good luck with this.

Alexandre FILLATRE
k venkatesh
RE: Plugin environment
April 28, 2012 4:16 AM
Answer

k venkatesh

Rank: Junior Member

Posts: 50

Join Date: February 20, 2012

Recent Posts

Hi Rahul,

I am also have the same problem,If you know please inform. Thanks in advance.
Hitoshi Ozawa
RE: Plugin environment
April 28, 2012 6:22 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

Have you seen this blog?

http://www.liferay.com/web/mika.koivisto/blog/-/blogs/7132115