File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes JSF navigation questions 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 "JSF navigation questions" Watch "JSF navigation questions" New topic
Author

JSF navigation questions

Surendra Kumar
Ranch Hand

Joined: Jul 04, 2006
Posts: 235
1) Does JSF navigation accept only JSP pages to be forwarded to?
e.g., if I create a navigation rule with <to-view-id>/AddServlet</to-view-id>, the page is searching for AddServelt.jsp. Can't we forward to servlets?

2) After getting into servlet [After renaming servlet to AddServlet.jsp in web.xml, it worked.] , how to get bean properties from the form? Do we need to get bean from facesContext or request object. I tried with request object (TestBean tb = (TestBean) request.getAttribute("TestBean");), but I am getting null values.

Can you please help?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15962
    
  19

Hmmm. I guess that an action method is expecting to build a new JSF context outbound and thus expects that a navigation rule will only feed into another JSF page. I've never done what you're trying so I don't know the simple solution - all my links to JSP's and servlets were done on the JSF page using commandLinks.

For a JSP or servlet to work with JSF data, the data has to be accessible. That means that your servlet can get at application and session scope beans in exactly the same way you would in a non-JSF app. However page scope is obviously out, and request scope is unavailable since JSF can only do that for JSF pages. Mostly because that's a large part of what JSF pages are is JSPs with the ability to have bean information pumped into and out of them.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
jQuery in Action, 2nd edition
 
subject: JSF navigation questions
 
Similar Threads
Call spring controller from jsf 1.1 faces-config.xml
navigation not working after validation fail
How to create a secure login system?
know about request scope in JSF(how to pass parameter from one page to other)
Issues with facelets and saveState?