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.

Alvaro
  • 25
  • 1
  • 8

1 Answers1

0

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,

Crosstalk22
  • 377
  • 3
  • 8
  • yep, I've already read it...but I found it utterly complicated, I was hoping to find a simpler solution. The main problem as a developer is that I shouldn't change any server configuration, I mean, I was supposed to sort it out (only) by coding. Thanks! – Alvaro Oct 02 '17 at 20:54
  • yeah I am not a fan of the POC, so usually what I do is set up a servlet filter or code in the default.jsp that reads the parameters and then puts them into a dynacache hashmap so that I can also get that in the portlets as the portal and portlets share the same sessionid – Crosstalk22 Oct 03 '17 at 12:51
  • thanks! I'll try that, I think your last suggestion is the most suitable in my case. – Alvaro Oct 05 '17 at 18:57