File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "onInit() and redirect" Watch "onInit() and redirect" New topic

onInit() and redirect

Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455

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 ?


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

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

check this thread
[ March 30, 2006: Message edited by: Rajeev Ravindran ]
I agree. Here's the link:
subject: onInit() and redirect
It's not a secret anymore!