wood burning stoves 2.0*
The moose likes JSF and the fly likes onInit() and redirect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "onInit() and redirect" Watch "onInit() and redirect" New topic
Author

onInit() and redirect

Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
hello,

This is my jsp code to do some action at pageload


and this is the code in the backing bean for this jsp ( im using RAD and WAS 6.0)



i wanted to forward the page to showmessage.jsp if the method call "checkAvailabiliy()" returns "norecords". i got the message "hello" printed on the console but its not forwarding the page to showmessage.jsp ! if i do the same in the submit action of a button it works fine. Could someone tell me how to make it work ?

Thanks,
Rajeev.


SCJP, SCWCD, SCBCD, Oracle Certified Professional (SQL n PL/SQL)
sachin mor
Greenhorn

Joined: Mar 30, 2006
Posts: 1
Hi rajeev ,

I am also facing similar problem . The method which you have written is not working because the method u have called gets invoked in the render response phase. One can change the view only before the render response phase
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
hi,

check this thread
[ March 30, 2006: Message edited by: Rajeev Ravindran ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: onInit() and redirect
 
Similar Threads
why the same URL shows different page in JSF
Page Load - is this doable?
Not Session Timeout, but throw javax.faces.application.ViewExpiredException
Call to JSF experts
java.lang.RuntimeException: Cannot find FacesContext