This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Nov 26, 2013, 6:45 PM
11 Posts

xPage 301 redirect

  • Category: Domino Designer
  • Platform: Windows
  • Release: 9.0
  • Role: Developer
  • Tags: xPages
  • Replies: 1

I'm trying to use an XPage to do a 301 redirect.

This code will do a 302 redirect ("Moved Temporarily").

facesContext.getExternalContext().redirect("http://www.cnn.com")

 

I discovered a post in StackOverflow which instructs that the following code will do a 301 ("Moved Permanently") which is what I desire, however I am unable to refine the code to work in an xPage because i can't find the relevant methods in externalContext.  Can anyone help?

externalContext.setResponseStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
externalContext.setResponseHeader("Location", destination);
facesContext.responseComplete();
Nov 26, 2013, 9:35 PM
2 Posts
Here is what we used
Hope this helps

var fcr = facesContext.getExternalContext();
var fcrResponse = fcr.getResponse();
fcrResponse.setStatus(301);
fcrResponse.setHeader("Location", url);
facesContext.responseComplete();

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal