aspose file tools*
The moose likes JSF and the fly likes JSF -- Capture Target View ID after FORWARD by Navigation Handler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF -- Capture Target View ID after FORWARD by Navigation Handler" Watch "JSF -- Capture Target View ID after FORWARD by Navigation Handler" New topic
Author

JSF -- Capture Target View ID after FORWARD by Navigation Handler

Ronald Depew
Greenhorn

Joined: Apr 26, 2006
Posts: 6
Java Ranch Community,

I'm attempting to design and create a Breadcrumbs component for a JSF Facelets Workflow Application.

I would like to assemble and stack the ViewIDs (in which I will prevent duplicates) into my Breadcrumbs component. I expect to do this in the PRE-Render Response phase.

Assuming a WAS environment and the default FORWARD technique of the NavigationHandler, I’m hoping to obtain the destination/target ViewId (of the new view) from the faces context.

(The view I expect is that of the Template Client Page which is available in Web Content.)

Will this work this way, even within a FACELETS application?

Thank you in advance,

Ron Depew
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

You're trying to muck around in JSF's internals. People are way too quick to do that. Most of the time, they're substituting a complex unreliable do-it-yourself solution for something that's already possible using the existing framework in a way that's much simpler and more elegant - and already debugged.

Views are not referenced by "id"s. They are referenced by a combination of URL and context. If you were to attempt navigation by brute-force manipulation of the digested view trees, you wouldn't have all the context, since part of the context is in the Model (backing beans). It just gets worse when you realize that the view state may have been serialized out to the client and back, so there's no permanent in-memory component to reference.

You could probably track progress using a PhaseListener or ServletFilter with a little help from PrettyFaces (for bookmarking). However, before you rush off and do all that, check the existing extension tagsets. I think either RichFaces or one of the MyFaces extension tagset may have a "breadcrumb" component. and if not either of them, possibly one of the other systems tat I'm less familair with. That could save a lot of time and work.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF -- Capture Target View ID after FORWARD by Navigation Handler
 
Similar Threads
Validating my understanding of JSF
help to understand basic concept in JSF
JSF and Facelets -- Restore View on HTTP GET Method
What is the difference between JSP and JSF ?
Questions about the future of JSF (comparing with GWT, JavaFX)