How to redirect to a page in webcenter sites

1.8k Views Asked by At

Is there any way to redirect to a page/template using webcenter sites tags? or we need to depend on standard j2ee respnose.sendRedirect() method??

2

There are 2 best solutions below

0
On

Redirecting a request is a tricky part in oracle webcenter sites. The response.sendRedirect code doesn’t work in sites JSP. Because the response headers are committed early in the page evolution, so we can not set the return status code in jsp in sites.

We can control this at client side immediately after loading the webpage. In javascript we can set the condition to forward to the respective page/url. Return the below javascript code as the response from the sites’s jsp page. Here is the best solution to achieve this task.

http://devble.com/forward-and-redirect-request-in-webcenter-sites/

0
On

If you're using a JSP wrapper, then you can't really do this since JSPs start sending the response headers too early. You'll have to render an HTML page with the meta redirect tag.

If your wrapper is XML or Groovy, then you can do this using WebCenter Sites APIs. There's a Groovy example here.