Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
ManMohan Vyas
need to control redirect after login(should always go to default page)
1 agosto 2012 0.41
Risposta

ManMohan Vyas

Punteggio: New Member

Messaggi: 18

Data di Iscrizione: 16 settembre 2010

Messaggi recenti

Hello,

Problem Statement: when page expires due to session expiry, it renders login page , and when I login back, it redirects to my previuos page. That means it remembers history. I want it to always redirect to some particular URL.

My approaches:


in LoginAction.java if I comment below code then it will always redirect to home page of user rather than remembering previous page
1
2
3redirect = HttpUtil.setParameter(
4                redirect, loginRedirectParameter, loginRedirect);


I also did try


auth.forward.by.last.path=false


but this also dont work.


Now what I want to achieve this( what I did with code change ) with some configuration or hooks without changing liferay's code base. Any Idea on How I can do this.
I dont think I can extend LoginAction.java as it extends strutAction rather than kernel's Action.


Any Idea on how I can achieve this ???
Amit Doshi
RE: need to control redirect after login(should always go to default page)
1 agosto 2012 0.26
Risposta

Amit Doshi

Punteggio: Liferay Master

Messaggi: 549

Data di Iscrizione: 29 dicembre 2010

Messaggi recenti

Hi Manmohan,

No need to do any code for it. You can directly do configuration.

Liferay default provide the settings for it.

Please find the attached image for the same.

Thanks & Regards,
Amit Doshi
Allegato

Allegati: forum.PNG (55,8k)
ManMohan Vyas
RE: need to control redirect after login(should always go to default page)
1 agosto 2012 0.42
Risposta

ManMohan Vyas

Punteggio: New Member

Messaggi: 18

Data di Iscrizione: 16 settembre 2010

Messaggi recenti

thanks !! but that is not what I am looking for , I have edited the post, kindly check problem statement their, for complete understanding on what I need
Amit Doshi
RE: need to control redirect after login(should always go to default page)
1 agosto 2012 0.50
Risposta

Amit Doshi

Punteggio: Liferay Master

Messaggi: 549

Data di Iscrizione: 29 dicembre 2010

Messaggi recenti

Can you plz try by adding this both property.

auth.forward.by.last.path=false
auth.forward.by.redirect=false

Thanks & Regards,
Amit Doshi
ManMohan Vyas
RE: need to control redirect after login(should always go to default page)
1 agosto 2012 1.31
Risposta

ManMohan Vyas

Punteggio: New Member

Messaggi: 18

Data di Iscrizione: 16 settembre 2010

Messaggi recenti

thanks !! but that dosent work either !! emoticon
Amit Doshi
RE: need to control redirect after login(should always go to default page)
1 agosto 2012 2.00
Risposta

Amit Doshi

Punteggio: Liferay Master

Messaggi: 549

Data di Iscrizione: 29 dicembre 2010

Messaggi recenti

Can you plz check from control pannel. The property that you have changed in portal-ext.properties is getting reflected in DB?
ManMohan Vyas
RE: need to control redirect after login(should always go to default page)
1 agosto 2012 2.14
Risposta

ManMohan Vyas

Punteggio: New Member

Messaggi: 18

Data di Iscrizione: 16 settembre 2010

Messaggi recenti

I am using liferay 5.2.3 I don't thin that is possible in it . If it is can you please guide
Amit Doshi
RE: need to control redirect after login(should always go to default page)
1 agosto 2012 2.48
Risposta

Amit Doshi

Punteggio: Liferay Master

Messaggi: 549

Data di Iscrizione: 29 dicembre 2010

Messaggi recenti

Go into Control panel --> Server Administrator -> Properties TAB - > Portal Properties.

Check your properties from that, is your properties are getting changed or not?
ManMohan Vyas
RE: need to control redirect after login(should always go to default page)
1 agosto 2012 3.17
Risposta

ManMohan Vyas

Punteggio: New Member

Messaggi: 18

Data di Iscrizione: 16 settembre 2010

Messaggi recenti

both properties are false in that!! emoticon

Do you know if their is any bug in version 5.2.3 for same.
Or any direction if I can control it through hooks?? as I know where is the problem
Amit Doshi
RE: need to control redirect after login(should always go to default page)
1 agosto 2012 4.27
Risposta

Amit Doshi

Punteggio: Liferay Master

Messaggi: 549

Data di Iscrizione: 29 dicembre 2010

Messaggi recenti

Not Configured on my lappy, Liferay Version 5.2.3, but you can do it with the help of HOOK. If you need to change in Action Class.
ManMohan Vyas
RE: need to control redirect after login(should always go to default page)
1 agosto 2012 22.20
Risposta

ManMohan Vyas

Punteggio: New Member

Messaggi: 18

Data di Iscrizione: 16 settembre 2010

Messaggi recenti

but how .. LoginAction implements struts's Action(in struts package) not kernel action ..will that still work ???
Hooks should extend life-ray's kernel Action(in kernel Package), is my understanding wrong ??
Subhasis Roy
RE: need to control redirect after login(should always go to default page)
1 agosto 2012 22.27
Risposta

Subhasis Roy

Punteggio: Expert

Messaggi: 284

Data di Iscrizione: 19 gennaio 2012

Messaggi recenti

Try this,

As you are using struts action, I hope from your login based on status(failure or success) you are redirecting to any jsp page.

So in your jsp page you can try the following code.

<%
String redirection = "http://localhost/group/guest/privatepage1";
%>

<script type="text/javascript">
window.location.href = "<%=redirection%>";
</script>
ManMohan Vyas
RE: need to control redirect after login(should always go to default page)
1 agosto 2012 22.38
Risposta

ManMohan Vyas

Punteggio: New Member

Messaggi: 18

Data di Iscrizione: 16 settembre 2010

Messaggi recenti

That loginAction is in liferay's code and I know where to modify , I am just asking if their is a neat way of achieving same without modifying liferay's code
Subhasis Roy
RE: need to control redirect after login(should always go to default page)
3 agosto 2012 3.26
Risposta

Subhasis Roy

Punteggio: Expert

Messaggi: 284

Data di Iscrizione: 19 gennaio 2012

Messaggi recenti

I guess not.

Else you have to write your own custom login portlet