留言板

how to implement filter in liferay and redirect to URL

Abutalib Shaikh,修改在7 年前。

how to implement filter in liferay and redirect to URL

Junior Member 帖子: 36 加入日期: 16-5-17 最近的帖子
Hi ,

we implement hook for filter mapping , filter works fine
- but we have following scenario :
1. if user is belongs to "test" group then
redirect to for e.g. "www.test.com" i used http sendredirect() method for that
- but problem is that seems no redirection is done

2. if user is not belongs to "test" group
do nothing, proceed as normal
do chain (); method call

- i implement filter and print some statements in do filter () method
- when hit a request method was call but for 1 request 15 times that statement (dofilter () method is calling)
- so may overheads on Database check every time user belongs to that group or not please suggest any alternative way for this

so please suggest way how i proceed and URL redirection issue


thank you in advance emoticon
thumbnail
Andrew Jardine,修改在5 年前。

RE: how to implement filter in liferay and redirect to URL

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
Hi Abutalib,

Your approach sounds correct -- can you share your code with us? Perhaps if we see the actual lines something will jump out for one of us.
thumbnail
Victor Zorin,修改在5 年前。

RE: how to implement filter in liferay and redirect to URL

Liferay Legend 帖子: 1228 加入日期: 08-4-14 最近的帖子
Generally it depends on how the filter is mapped,
e.g. if somehow your filter has been on the invocation of portlet render urls and there 15 of them to be called on the page, you filter will be called 15 times.
On another note, very likely that the database will not be called 15 times, only once due to caching. However it is still an overhead.
Abutalib Shaikh,修改在5 年前。

RE: how to implement filter in liferay and redirect to URL

Junior Member 帖子: 36 加入日期: 16-5-17 最近的帖子
Thank's for the feedback,

I have achieve this by using service pre action with hook plugin