Open Normal URL after xPage Save

How can I open a non-Xpage document via Server Side Javascript after I submit a form (or do any action) . I can’t seem to find any option to just have it open a URL that I pass.

If I put in a URL for the page name in the Open Page options, it just assumes the URL is an xPage and appends that url onto the exiting database.

I feel like I’m missing something obvious here. Any help would be appreciated. Thanks.

Subject: Use context.redirect()

In response to your action, you can call save() and then context.redirect() with a complete URL (http://myserver/mypage). That should do the trick.

Subject: Does not work

Sorry - for the delay in checking this out. That does not work. What that does is inserts that url at the end of URL for the current database, and the puts the .xsp at the end. It seems to still assume you are passing an xPage name.

So if I try context.redirectToPage(“http://yahoo.com”)

it will do

http://originaldomain.com/databasename.nsf/http://yahoo.com.xsp

Subject: This should work

Instead of context.redirectToPage(String), use this:

facesContext.getExternalContext().redirect(“http://www.mindoo.com”);

Subject: Thanks!

I was fighting over the same thing…

This works nicely.