aspose file tools*
The moose likes Struts and the fly likes Difference between Declarative and Programmatic Exception in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Difference between Declarative and Programmatic Exception in struts" Watch "Difference between Declarative and Programmatic Exception in struts" New topic
Author

Difference between Declarative and Programmatic Exception in struts

Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
Can you give difference between Declarative and Progammatic exception in struts.Two ways of handling exceptions in struts.
when to use which.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'd hope the difference was obvious.

When to use either depends completely on your application, how you want to handle errors, and when.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16012
    
  19

"Declarative" means that you declare rules from a fixed set of options.

"Programmatic" means that you actually write program code.

HTML is declarations, JavaScript is programmatic, for example.

The primary advantages of declarative specifications is that they're simple, easier to validate, and usually have less overhead. The primary advantage of the programmatic is that it's more flexible. You're not limited to only the options that whoever designed the declarative rules defined.

That's true of any system, not just Struts. However, I'm not quite sure of what you mean by "declarative exception handling", unless you mean things like the error page stuff in the web.xml file.


Customer surveys are for companies who didn't pay proper attention to begin with.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Struts has Struts-specific declarative exception handling to handle things within the framework.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60985
    
  65

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between Declarative and Programmatic Exception in struts