Portlet Finish URL

Hi,
I’m sending one url to the portlet using finishUrl parameter. When I tried to use the redirect to the url that I send in finishURL parameter, I saw that the &wmp_rt=render is removed from my URL, this and all the parameters that I sent after the taskId.

Example:
URL sent in finishUrl parameter by my application:
http://localhost:8585/meta/default/wm_xt_fabricfolder/0000068242?wmp_tc=68243&wmp_rt=render

URL received in portlet, using finishUrl parameter:
http://localhost:8585/118A315A-109C-479A-118C-724B9DD8C744.task.app.details.page?wmp68512.requestID=0.10169666576726621&wmp68512.currentTab=TaskData&wmp68512.taskID=69727

Can you help me on this?

Regards,

Hi Jose,

Can you please provide more details about how you build your Porttlet URL.

Ex:

    IPortletURL finishURL = createActionUrl();
    finishURL.clearParameters();
    finishURL.clearState();
    // call action when navigation
    finishURL.setTargetAction("#{activePageBean.refresh}");
    finishURL.setBaseURL(...);
    finishURL.setPortlet(...);
    finishURL.setParameter(...);
    finishURL.setParameter(...);

br,
Vlad

Hi Vlad,
This is the code that I’m using to generate the portlet URL:
com.webMethods.caf.portlet.IPortletURL portletURL = createRenderUrl();

	portletURL.clearParameters();
	String aux= ((HttpServletRequest)this.getFacesContext().getCurrentInstance().getExternalContext().getRequest()).getServerName();
	int aux2=((HttpServletRequest)this.getFacesContext().getCurrentInstance().getExternalContext().getRequest()).getServerPort();
	
	portletURL.clearState();
	
	
	portletURL.setParameter("showUnderAdmin", showUnderAdminInput);
	
	return portletURL.toString();

If I print the portletURL content, I’m able to see “&wmp_rt=render” and “showUnderAdmin” parameter. Also, I can see both parameters in the browser when I do the redirect. My problem is that when I try to get the URL in the portlet side, both parameters (“&wmp_rt=render” and “showUnderAdmin”) are missing from the URL.

Regards,

Hi Jose,

I have not seen in any of your two URLs posted in the first comment the “showUnderAdmin” parameter.

Just to be clear about the steps you have done:

  1. you have created the finishURL instance
  protected IPortletURL createFinishURL() throws Exception {
    IPortletURL finishURL = createActionUrl();
    finishURL.clearParameters();
    finishURL.clearState();
    // call action when navigation
    finishURL.setTargetAction("#{activePageBean.refresh}");
    finishURL.setBaseURL(...);
    finishURL.setPortlet(...);
    finishURL.setParameter(...);
    finishURL.setParameter(...);

    return finishURL;
  }
  1. you have created a PortletURL instance on which you perform the actual redirect:
IPortletURL portletURL = createRenderUrl();
      portletURL.clearParameters();
      portletURL.clearState();
      portletURL.setBaseURL(...);
      portletURL.setPortlet(...);

      portletURL.setParameter("cancelUrl", createCancelURL().toString());
      //see finishURL initialization above
      portletURL.setParameter("finishUrl", createFinishURL().toString());
      portletURL.setParameter("currentTab", "TaskData");

      getFacesContext().getExternalContext().redirect(portletURL.toString());

As you can see the finishUrl is sent as an actual parameter.

Also, please not that the “showUnderAdmin” parameter must be defined as a Portlet Preference on the target portlet.

br,
Vlad

Hi Vlad,
My problem, is not the url construction, but why the “&wmp_rt=render” and all the parameters after taskId are being removed from the url.
For clarification, this are all the steps that I’m doing:

1.Building the url inside a portlet, this url has the finishUrl parameter, that looks like this:
http://localhost:8585/meta/default/wm_xt_fabricfol...242?wmp_tc=68243&wmp_rt=render&showUnderAdmin=true

2.Doing the redirect to the previous url - This url represents one task;

3.Inside the task, get the finishUrl parameter, that was sent in the URL built in 1, if the user chooses to “complete” or “return” task. When I get the URL, this is what I’m getting:
http://localhost:8585/118A315A-109C-479A-118C-724B...TaskData&wmp68512.taskID=69727

All this steps are working fine, my problem is in step 3,when I get the url sent in finishUrl parameter, all the parameters after the taskid are missing.

Regards,

Hi Jose,

I have tried to add all kind of parameters and it worked fine for me.

If you provide more details (code) about how you build the finishURL and redirectURL then maybe someone on the forum will spot the problem.

PS:
I can see that you do not set the BaseURL and Portlet parameters. Also, the host and port (http://localhost:8585) should not be present in the finish URL, the relative URL is enough.

br,
Vlad

Hi Vlad,
Sorry for take so long to answer.
My problem was that I wasn’t using the setTargetAction method when building my url. Thanks to your example I was able to fix it.

Regards,