javapostportletwebsphere-portalportletbridge

Getting post data JSR-286 portlet running on IBM websphere portal 8.0


I have one JSR-286 portlet running on IBM Websphere Portal 8.0 This portlet is published under the following friendly url: http://myServer/wps/portal/mySite/menu/my-portlet-friendly-url

There is an external page, in another server (and domain), which wants to send POST data to my portlet.

For instance, imagine this situation:

External page http://www.externalServer.com/externalPage.html

<form method = "POST" action = "http://myServer/wps/portal/mySite/menu/my-portlet-friendly-url">
<input type = "hidden" name = "externalParam" value = "valueExternalParam"> </ input>
<input type = "submit" value = "submitData"> </ input>
</ form>

Then, I would like to read the value of "externalParam" ("valueExternalParam") inside my portlet.


Solution

  • when a portlet is called within the scope of portal, url params are not going to be passed to the portlet easily, you have to target the portlet window which is the portlet on the page, the easiest way to do this is to use the Pieces of content api, or POC api https://www-10.lotus.com/ldd/portalwiki.nsf/dx/Passing_query_parameters_to_JSR-286_portlets_using_existing_IBM_WebSphere_Portal_capabilities#An+existing+JSR+286+solution

    and build a url that targets it and lets you pass in the url params you want your other option is to trap it in the theme, and then make it available via a portlet service to your portlets,