• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Servlet 3, <async-supported>true</async-supported> in web.xml vs asyncSupported=false

 
Greenhorn
Posts: 7
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
web.xml


Class definition


After deployment, whether is it Sync/Async servlet OR who will take priority web.xml or Class defination?
 
Saloon Keeper
Posts: 24315
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As a general rule, XML declarations override annotation declarations.

Three reasons for this:

1. XML declarations are more flexible. You don't have to recompile anything.

2. It's sometimes convenient to provide a bean with default properties, but still have the ability to override those properties without altering source code.

3. You might be creating more that one instance of the class object. For the most part, annotations are going to be applied to all instances created of an object. But when one of those properties varies per instance, it's not easy to make a "one-size-fits-all" annotation. So you'd use XML to override the annotations. For example, if you're defining a bean for an IoC framework where each bean instance has a discrete name, but there might be several instances of that bean.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic