Fórumok

retrieving portlet request from http request

sravan kumar, módosítva 9 év-val korábban

retrieving portlet request from http request

Junior Member Bejegyzések: 78 Csatlakozás dátuma: 2013.02.19. Legújabb bejegyzések
Hi,
using the below code we can get the portlet request from http request,
PortletRequest portletRequest = (PortletRequest)request.getAttribute(JavaConstants.JAVAX_PORTLET_REQUEST);
My question is if we get the portlet request from http request, how the portlet request will vary from one portlet to another portlet.


thanks.
sravan kumar
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Liferay Legend Bejegyzések: 14915 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
The portlet request has specific info that Liferay uses to determine which portlet instance to pass the request off to.

Outside of the Liferay stuff that changes from one req to another, portlets have different values they depend on for their own.

And frankly, I'm not sure what you're doing, but in 8 years developing under Liferay I've never had to access the portlet request this way. My guess, you don't know what you're doing and therefore are trying to bulldoze your way through.
thumbnail
Sushil Patidar, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Expert Bejegyzések: 467 Csatlakozás dátuma: 2011.10.31. Legújabb bejegyzések
Hi,
I agree with David why you need this way.
Anyways Liferay sets JavaConstants.JAVAX_PORTLET_REQUEST attribute when portlet is getting rendered.

Regards
sravan kumar, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Junior Member Bejegyzések: 78 Csatlakozás dátuma: 2013.02.19. Legújabb bejegyzések
while writing the custom taglib we have to use above code to get the portlet request. or is there any other way to get the portlet request in tag class.
thumbnail
Sushil Patidar, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Expert Bejegyzések: 467 Csatlakozás dátuma: 2011.10.31. Legújabb bejegyzések
Hi,
For the custom taglib purpose that can be used.If you check "/html/taglib/init.jsp",Liferay also uses following attributes for taglib.
PortletRequest portletRequest = (PortletRequest)request.getAttribute(JavaConstants.JAVAX_PORTLET_REQUEST);

PortletResponse portletResponse = (PortletResponse)request.getAttribute(JavaConstants.JAVAX_PORTLET_RESPONSE);


Regards
sravan kumar, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Junior Member Bejegyzések: 78 Csatlakozás dátuma: 2013.02.19. Legújabb bejegyzések
if use to retrieve portlet request this way, how portletrequest vary from one portlet to another portlet.?
thumbnail
Sushil Patidar, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Expert Bejegyzések: 467 Csatlakozás dátuma: 2011.10.31. Legújabb bejegyzések
Hi,
In render phase of each portlet, portlet request specific to that portlet is created.

Regards
thumbnail
Sandip Patel, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Regular Member Bejegyzések: 205 Csatlakozás dátuma: 2011.01.05. Legújabb bejegyzések
As HttpRequest is not vary from one servlet to other servlet, PortletRequest is not vary from one portlet to other portlet. PortletRequest is Liferay specific HttpRequest. PortletRequest Extends HttpRequest So PortletRequest has own method for portlet application.
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Liferay Legend Bejegyzések: 14915 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Sandip Patel:
As HttpRequest is not vary from one servlet to other servlet, PortletRequest is not vary from one portlet to other portlet. PortletRequest is Liferay specific HttpRequest. PortletRequest Extends HttpRequest So PortletRequest has own method for portlet application.


FAIL.

PortletRequest is a JSR-168 specified interface and has no Liferay-specific information.
thumbnail
Jack Bakker, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Liferay Master Bejegyzések: 978 Csatlakozás dátuma: 2010.01.03. Legújabb bejegyzések
David, if Sandip changed "Liferay specific" to "JSR-168 specified" would his statement be otherwise correct ?
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Liferay Legend Bejegyzések: 14915 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Well, no, cuz PortletRequest does not extend or have anything to do with "HttpRequest" (and I think he actually meant HttpServletRequest although I'm not sure).
thumbnail
Jack Bakker, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Liferay Master Bejegyzések: 978 Csatlakozás dátuma: 2010.01.03. Legújabb bejegyzések
Oh I see now. Thanks again David

David: 5989 posts
Hitoshi: 7990

only ~2000 to go....
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Liferay Legend Bejegyzések: 14915 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Jack Bakker:
David: 5989 posts
Hitoshi: 7990

only ~2000 to go....


The worst part about that Jack - I post a lot (IMHO), but I see ~2000 posts as probably at least a year's worth of posting just to get there. The only thing working in my favor is Hitoshi isn't posting anymore, otherwise I wouldn't stand a chance emoticon

I guess if I started posting on threads that already had some discussion going on it I could do it in less time, but I figure if there's already a discussion going on they don't need me jumping in, whereas the lone post with no replies, those folks are looking for help and getting no response at all and really need the help...

Now if I could only keep my attitude in check (or sense of humor, as the case may be)... emoticon emoticon
thumbnail
Sandip Patel, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Regular Member Bejegyzések: 205 Csatlakozás dátuma: 2011.01.05. Legújabb bejegyzések
Thanks David for correct me !!!
thumbnail
James Falkner, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Liferay Legend Bejegyzések: 1399 Csatlakozás dátuma: 2010.09.17. Legújabb bejegyzések
David H Nebinger:
Jack Bakker:
David: 5989 posts
Hitoshi: 7990

only ~2000 to go....


The worst part about that Jack - I post a lot (IMHO), but I see ~2000 posts as probably at least a year's worth of posting just to get there. The only thing working in my favor is Hitoshi isn't posting anymore, otherwise I wouldn't stand a chance emoticon

I guess if I started posting on threads that already had some discussion going on it I could do it in less time, but I figure if there's already a discussion going on they don't need me jumping in, whereas the lone post with no replies, those folks are looking for help and getting no response at all and really need the help...

Now if I could only keep my attitude in check (or sense of humor, as the case may be)... emoticon emoticon


I feel your pain - I'm still chasing Ron Sarayudej for total # of blog posts. Maybe I should start posting "Thanks dude" blog posts more! emoticon

Thanks again for all of your wonderful posts (and Jack, too!). Humor is the great equalizer, so keep it up emoticon

I've been working quietly on some new dashboards for the forums to get people to the threads that need the most help emoticon Soon!
thumbnail
Jack Bakker, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Liferay Master Bejegyzések: 978 Csatlakozás dátuma: 2010.01.03. Legújabb bejegyzések
Thanks James

x++
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Liferay Legend Bejegyzések: 14915 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Jack Bakker:
Thanks James

x++


Hugs and kisses? emoticon
thumbnail
Jack Bakker, módosítva 9 év-val korábban

RE: retrieving portlet request from http request

Liferay Master Bejegyzések: 978 Csatlakozás dátuma: 2010.01.03. Legújabb bejegyzések
David H Nebinger:
Jack Bakker:
Thanks James

x++


Hugs and kisses? emoticon


emoticon