GeeCON Prague 2014*
The moose likes Portals and Portlets and the fly likes Struts Application to a Portlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Struts Application to a Portlet" Watch "Struts Application to a Portlet" New topic
Author

Struts Application to a Portlet

Ankur Srivastav
Ranch Hand

Joined: Aug 31, 2009
Posts: 57

I am trying to convert a Struts 2 application to a Portlet to finally deploy it in Liferay Portal Server.

Problem is there aren't any useful resources available on the net for this. I have explored the Portal Bridges provided by Apache but I am not quite sure if they work with Liferay. Also they havent mentioned about the changes needed for the Action Classes which use Action Servlet and other Struts classes.

If any of you had success with Bridges then kindly provide the steps you followed.

Any help will be greatly appreciated.

Thanks..


Sun Certified Java Programmer v 1.4
Oracle Certified Associate, Java SE 7 Programmer
JEE 5 Web Component Developer Certified Professional
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Here's a little CBT tutorial I put together on creating and deploying a Struts portlet to WebSphere. For liferay, the process is similar:
Developing and deploying a Struts Portlet

Good luck!

-Cameron McKenzie
Ankur Srivastav
Ranch Hand

Joined: Aug 31, 2009
Posts: 57

Thanks, can you tell me what are the changes needed for Action Class in Struts. Also which lib jar files did you include to get it running.

rashmi shivanna
Greenhorn

Joined: Aug 19, 2009
Posts: 15
Hi ,
I have one deployed struts application in jboss portal it is working fine but for the login validation i have writen my own login action beacuse i need to check in Microsoft crm database insted of portal database to know he is valid user i tried to use j_security_check but i couldn't use . so i have wrtien struts action for login check . till this is working . now i need to display which user has logged in the header page . i am not able to set the portlet session in login action class in struts . my action class extends Action . i downloaded rpsstrutsportletfromtutorial.war also but i didn't find it was using any portlet session . can you please help me how to set portlet session in action class and how to retrive it in JSP file .
Thanks in advance .

Ankur Srivastav
Ranch Hand

Joined: Aug 31, 2009
Posts: 57

Hi,

Did you convert a Struts App to a Portlet? Can you share the steps for the same. I am finding it a little complex to convert my application to a Portlet.
Problem is coming mainly with the Action Class which uses struts Action classes. Although I have specified the jar files.

Thanks...
Ankur Srivastav
Ranch Hand

Joined: Aug 31, 2009
Posts: 57

Hi Cameron,

I am getting this error when I try to deploy your example war in Liferay:

java.lang.ClassNotFoundException: org.apache.jetspeed.portlet.ServletContextProviderImpl

Details Attached....

Do I need to remove certain code for Liferay or add something
Ankur Srivastav
Ranch Hand

Joined: Aug 31, 2009
Posts: 57

I got this one resolved, I will post the solution soon. I managed to convert a sample Struts application to a Portlet and deploy it in Liferay.

Now my focus is to convert an application which uses Struts2 and EJB and make that into a Portal.

If anyone of you has done that, kindly share the ways/steps for the same.

Thanks...
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9398
    
    2

Is there any similiar tutorial that shows how to integrate a Struts application to a JBoss Portal?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Ankur Srivastav
Ranch Hand

Joined: Aug 31, 2009
Posts: 57

Actually I have managed to convert an existing Struts EJB Application to a JSR 168 Portlet. Now I am using IBM Websphere and Liferay for the same.

I have outlined all the steps here : http://createportlet.blogspot.com/2009/10/struts-and-ejb-application-to-jsr-168.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Application to a Portlet