Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Remove URL Parameters in ADF

892950Apr 9 2012 — edited Oct 5 2012
Hello everyone,

As you can see from the thread subject, I want to remove parameters from the URL.
I create an URL with parameters to access the details of a specific entity. When the URL is used, a method call, set as an entry point for a task flow, reads the URL parameters and redirects the user to the details page. If there are no parameters, the user is redirected to a search form. I'm using task flows with fragments and managed beans set to page flow scope.

The problem is that those parameters never leave the URL. If I navigate to another task flow they remain there. Which is fine, until I return to the task flow that reads the parameters. They are still there, so the user is, again, redirected to the details page.

I’ve tried to acquire the HttpServletRequest object and call ‘remove’ of the parameter on the ‘getParameterMap()’ function result, but it throws a runtime exception.

Another approach was to calculate the full URL of the current page, without the parameter, and using FacesContext.getCurrentInstance().getExternalContext().redirect(url) to force the browser to refresh the page without the parameter, that was previously saved as a session variable. It didn’t work, only a blank page was shown and the browser navigation bar did not show the new URL.

The third attempt was basically the same as the above, but instead of redirecting by code, a url-view component was added to the taskflow with the purpose of making it responsible for the redirect.
Again, it did not work. Desperation strikes once again and I change the url-view URL to http://www.google.com. And again, it did not work.

Any idea on how to remove a parameter from an URL, so that it disappears from further requests?

Thanks in advance,
Pedro
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 2 2012
Added on Apr 9 2012
4 comments
784 views