This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
You can probably crank up the log levels for your JSF implementation and see the gory details, but I rarely get that desperate. The mechanism "just works", except when it doesn't, and then you don't usually get any error messages.
Several things can mess you up.
1. If the action method is never called, obviously it won't navigate. So you can put a trace print message in the action method to make sure it called. Or set a debugger breakpoint. The action method will only be called if all fields in the submitted form pass validation, so an "h:messages" tag on the page can point out any validation errors.
2. If there's no navigation handler for the outcome you indicate, it won't navigate. Not a problem in your case, though unless I missed something.
3. If the destination URL does not exist, it won't navigate. Note that I said URL and not "page definition", "file", or "resource". That's because JSF navigation is to a URL and URLs are NOT the same thing as files.
4. If the destination is not a JSF URL, it won't navigate. You can't pass from JSF to a JSP, for example using navigation. If the JSF page needs to advance to a JSP or servlet or non-JSF URL such as Struts, you can't do that in the action method via navigation. You'll have to do a forward in the action processor or use a "h:outputLink", depending on whether or not you have action processing to do.
An IDE is no substitute for an Intelligent Developer.
Joined: Aug 09, 2011
thanks for your reply.
I have created 2 jsp files. /test.jsp and company/x/y/firstview.jsp. On test.jsp I have provide a link and called method of ManagedBean which returns a string and navigates to company/x/y/firstview.jsp (using faces-config.xml). This works fine.
On firstview.jsp, I have used JSF tags and fileds (i.e. radio buttons, button etc) and are linked with managed bean. I have also provided a button on firstview.jsp which calls the action method of managed bean and as per business logic it should get navigated back to test.jsp.
Action method is called successfully, but the page is not navigated.
Can you please more detail on Point 4 that you have mentioned, or provide an external URL for detail reference.