Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Andrew Jardine
Struts Action Hook
August 26, 2013 11:54 AM
Answer

Andrew Jardine

Community Moderator

Rank: Liferay Legend

Posts: 1062

Join Date: December 22, 2010

Recent Posts

Hey Guys,

I am sure that whatever I am doing wrong is an easy fix but I just can seem to see what the issue is.

I have created a hook that is used to override the registration JSP and action. The JSP hook is complete with
unwanted fields removed and wanted ones added. The struts action override for /login/create_account is done as
well and in my class I have logging that is visible during registration. The issue I am having is at the end of the
process.

As a last step when the user is registered, I want to forward the user to the login action with the login/password
being passed so that my LoginAction hook is invoked and the user is authenticated. I am trying to use this --

portletURL.setParameter("saveLastPath", "0");
portletURL.setParameter("struts_action", "/login/login");

actionRequest.setAttribute( "login", ParamUtil.getString( actionRequest, "emailAddress" ) );
actionRequest.setAttribute( "password", ParamUtil.getString( actionRequest, "password1" ) );
actionRequest.setAttribute( "authType", CompanyConstants.AUTH_TYPE_EA );

System.out.println(portletURL.toString());
actionResponse.sendRedirect( portletURL.toString() );

but am having no louck. The logging in my authentication hook is not showing and there are no error messages. The user is simply being dropped
onto the public homepage with a status of "not signed in".

Any help?
Zsigmond Rab
RE: Struts Action Hook
August 26, 2013 12:05 PM
Answer

Zsigmond Rab

LIFERAY STAFF

Rank: Liferay Master

Posts: 650

Join Date: January 4, 2010

Recent Posts

Hi Andrew,

I think, this thread can help you.

Regards,
Zsigmond
Ahamed Hasan
RE: Struts Action Hook
August 26, 2013 10:23 PM
Answer

Ahamed Hasan

Rank: Expert

Posts: 306

Join Date: April 13, 2007

Recent Posts

Hi Andrew,

I have a complete example of customising the registration page and the flow with the help of a set of JSP's and struts over ride.

You can refer to this link and see if this is going to be of some help to you.

Yours truly,
Ahamed Hasan
Author, Liferay Portlet Cookbook