-
1. Re: Page Redirect
ppitonak May 25, 2011 6:36 PM (in response to lessonz)Hi,
faces-redirect=true is probably what you're looking for. Just append it to the outcome of your method.
public String foo () {
//...
return "/bar/welcome?faces-redirect=true";
}
Regards,
Palo
-
2. Re: Page Redirect
lessonz May 25, 2011 6:39 PM (in response to ppitonak)Pavol, I appreciate the response, but I'm not sure I understand. I'm looking for the front end code to redirect to a URL that is present in the backing bean. When the bean enters scope, it's reading this in from a configuration file. So, I want the front end to be able to use that value.
-
3. Re: Page Redirect
lessonz May 26, 2011 7:17 PM (in response to lessonz)I ended up using something like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<script type="text/javascript">
function redirect(url){
window.location = url;
}
</script>
<h:head >
<title>Facelet Title</title>
</h:head>
<h:body onload="redirect('#{redirectBean.url}')" >
<h:outputText value="#{redirectBean.url}"/>
<p>Hello from Facelets</p>
</h:body>
</html>