redirect after succesful login

35071, modified 17 Years ago. Regular Member Posts: 120 Join Date: 8/30/07 Recent Posts
I need help: I followed the instructions on http://wiki.liferay.com/index.php/Custom_redirect_after_login to redirect to another page after succesful login, but it doesn't work. Can you give me a working example to redirect after successful login to e.g. the wsrp portlet, what do I have to do to approve this!
thumbnail
188122, modified 17 Years ago. Liferay Master Posts: 878 Join Date: 10/8/07 Recent Posts
Look here:

http://wiki.liferay.com/index.php/Customizing_the_default_page_after_login

default.landing.page.path=/web/guest/home
35071, modified 17 Years ago. Regular Member Posts: 120 Join Date: 8/30/07 Recent Posts
Thanks, I know this page, but how do I get for example to the wsrp portlet? Please can you give me an example, how it works!
Do I have to write: default.landing.page.path=/c/portal/wsrp??
thumbnail
188122, modified 17 Years ago. Liferay Master Posts: 878 Join Date: 10/8/07 Recent Posts
No, you can create a page, put wsrp portlet there. Then you assign FriendlyURL in page properties and put it into your default page.
Ash J, modified 14 Years ago. Junior Member Posts: 83 Join Date: 3/22/11 Recent Posts
Hi,

Thanks for the information, but it does not work for me.

I'm trying to forward to a page after logging in, and I have specified the line
"default.landing.page.path=/web/guest/dashboard"
in my portal-ext.properties file. But, still it does not get redirected to the page. After logging in also, it remains in the welcome page.

Please help.

Thanks,
-ash
Ash J, modified 14 Years ago. Junior Member Posts: 83 Join Date: 3/22/11 Recent Posts
Hi,

I solved the problem myself by setting it in the below page

Portal -> Settings -> General -> Navigation

Thanks,
-ash
Firas B&D, modified 13 Years ago. Junior Member Posts: 43 Join Date: 10/3/11 Recent Posts
Hey do u can please explain to me how to do that, I want after logging successefully, that the user logged be redirected to his private page home. How to do that? Any help
thumbnail
Mani kandan, modified 13 Years ago. Expert Posts: 492 Join Date: 9/15/10 Recent Posts
Follow this link should work.
thumbnail
Mahammad Ashik A, modified 6 Years ago. Junior Member Posts: 81 Join Date: 7/17/17 Recent Posts

Hi,

I am not able open below link.

please help me.

Thank you..

thumbnail
Mahammad Ashik A, modified 6 Years ago. Junior Member Posts: 81 Join Date: 7/17/17 Recent Posts
create a new componenet class. Then add below the codes.. Its working fine for me.


import javax.servlet.http.HttpSession;

import org.osgi.service.component.annotations.Component;

import com.liferay.portal.kernel.events.ActionException; 
import com.liferay.portal.kernel.events.LifecycleAction; 
import com.liferay.portal.kernel.events.LifecycleEvent;
import com.liferay.portal.kernel.struts.LastPath;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.WebKeys;

@Component(
        immediate = true, 
        property = { "key=login.events.post" }, 
        service = LifecycleAction.class
    )

public class PreLogin implements LifecycleAction {
    public void processLifecycleEvent(LifecycleEvent lifecycleEvent) throws ActionException {
        final HttpSession session = lifecycleEvent.getRequest().getSession();
        String path="/web/guest/<page-name>";
        LastPath lastpath=new LastPath(StringPool.BLANK, path);
        session.setAttribute(WebKeys.LAST_PATH, lastpath);
   
        
    }

}