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);

Related posts:

Share

About number.0