I wrote my own servlet in Liferay and I want to know which user page calls it and knows other parameters, such as the theme. But request attributes and session fields are zeros.
How to get a custom servlet to receive a request like a portlet?
thanks
PS I do not want to use this solution https://www.everit.biz/web/guest/blog/-/blogs/getting-current-liferay-user-in-a-standalone-webapp?_33_redirect=/web/guest/ blog
which reads cookies manually. I want to do this, e.g. Liferay, i.e. Using its API. Is it possible?
Update 1.
I have a portlet and servlet in one WAR. I know who I am (registered user) from the JSP portlet, like this:
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY); themeDisplay.getUser()
Now I want to do the same from the servlet. Is it possible?
I work in eclipses that automatically deploy.
source share