Mihail Zheludev
Mihail Zheludev

Reputation: 166

How can get current portlet request in spring bean?

Portlet was created as GenericPortlet not Spring MVC portlet.

I need get current portlet request in my bean. Is there way to achive it?

Upvotes: 0

Views: 933

Answers (1)

Georgy Gobozov
Georgy Gobozov

Reputation: 13721

You can try

RequestAttributes attrs = RequestContextHolder.getRequestAttributes();
if (attrs instance of PortletRequestAttributes){
    PortletRequest request = ((PortletRequestAttributes) attrs).getRequest();
}

Upvotes: 2

Related Questions