To Create PortletRequest from HttpServletRequest ?

35 views
Skip to first unread message

Syed Imtiaz

unread,
Feb 28, 2016, 11:44:30 PM2/28/16
to Portal/WCMTechs
Hi Guys,

How are you all doing?

Is there any way to create PortletRequest explicitly from a HttpServletRequest object for the requests coming from Ajax calls to the servlet?

Thanks & Regards,
Imtiaz B Syed

Syed Imtiaz

unread,
Feb 29, 2016, 12:01:03 AM2/29/16
to Portal/WCMTechs
Sorry, I forgot to mention why I need this :-)

I need to use credential vault to store the passwords which will be needed by portlets and servlets to do utility operations. Portlets would do fine but when a plain request comes to servlets they need to read the credential vault for password and hence I need PortletRequest object in servlet. Please suggest if you have any other solutions as well. Thank you.

Regards,
Imtiaz B Syed.

Ravi Kota

unread,
Feb 29, 2016, 9:59:15 PM2/29/16
to portalw...@googlegroups.com
Not sure if I understand the requirement well enough, anyway...since servlet request will be available in both portlet and servlet, store vaults in servlet request and get them in both places.

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Portal/WCMTechs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to portalwcmtech...@googlegroups.com.
To post to this group, send email to portalw...@googlegroups.com.
Visit this group at https://groups.google.com/group/portalwcmtechs.
For more options, visit https://groups.google.com/d/optout.

Gmail

unread,
Mar 1, 2016, 1:49:54 PM3/1/16
to portalw...@googlegroups.com
Why dont you use resource request instead of httprequest so that portlet request is availabe in ajax as well as portlet. 

If not, keep required values in http session then convert portlet request to httprequest and read them in portlet. 

If nothing works, never mind

Sent from my iPhone

Ravi Kota

unread,
Mar 1, 2016, 3:07:28 PM3/1/16
to portalw...@googlegroups.com
Mouli,

Second option will not work for sure, as soon as you change the request, session will also change 

Ravi

Sent from my iPhone

Syed Imtiaz

unread,
May 1, 2016, 3:31:50 AM5/1/16
to Portal/WCMTechs
Thank you guys for putting in valuable thoughts. There are existing servlets so I can't go for serveResource cycle. I should drop the plan as getting portletRequest objects from HttpServletRequest can't be obtained :-)
Reply all
Reply to author
Forward
0 new messages