This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSF and the fly likes What is declarative navigation? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "What is declarative navigation?" Watch "What is declarative navigation?" New topic
Author

What is declarative navigation?

dennis deems
Ranch Hand

Joined: Mar 12, 2011
Posts: 808
Every time I try to learn about JSF I encounter this term, without any explanation of what it is. Could someone please explain?
J Miller
Ranch Hand

Joined: Oct 21, 2010
Posts: 67
Anybody correct me if I'm wrong on this but...

From my understanding declarative navigation is when you declare in the config files where you will go if you click a particular button. For instance, on your actual jsf page you might have a button that looks like this:



Then in your config.xml files you'll have something like this:



So in your button you're not actually hard-coding the location of a file, but rather a string. Your config files know that whenever that particular string gets returned, it should send you to whatever place you have set up in your xml files.

That's my understanding anyway, somebody please let me know if I'm wrong.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

"Declarative" anything in programming terms means that instead of Java code (or whatever language), you're defining something in a simpler, less flexible way. Declarative notation normally has no conditional constructs[*] and the overall syntax is simpler, making it easier to validate the declarations than it would be to debug Java code.

I put the asterisk [*] next to "no conditional constructs" because you can make a navigational rule conditional (contingent on an EL expression result), but what I mean is that the individual navigational rules themselves support nothing like an if/then/else or do/while structure.


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: What is declarative navigation?