Windows – Linux – Mac OSX Guides

How to redirect to an url in Xpages

This took me sometime to figure out. In order to redirect to an external link/url/page in Xpages, you can not use the context object, for example

 

context.redirectToPage(…)

OR

context.redirectToHome()

 

Those functions are used only when you want to redirect to another Xpages. If you want to redirect to another link, use facesContext instead:

 

var url = "<url_link>";

facesContext.getExternalContext().redirect(url);

Tagged with:     , ,

Related Articles

Loading Facebook Comments ...

4 Comments

  1. Atin

    Hi,

    I am using the frameset and want to redirect to the url so that the new target will open in the parent window and not in the self. Pls suggest the option to do that.

  2. devin

    How to redirect to an external link/url/page in Xpages in client side?

Post your comments

Your email address will not be published. Required fields are marked *