Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between Declarative and Programmatic Exception in struts

 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18302
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts has Struts-specific declarative exception handling to handle things within the framework.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic