• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

can we use annotations instead of web.xml?

 
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i don't know weather it can be done or not,
but is it possible to write servlet without DD, i mean can we use annotations instead of deployment descriptor to write a servlet?
if so, how??
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Only with Servlets 3.
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does that order filters? With web.xml you can determine the order filters are called in, but I didn't see anything about that in the WebFilter annotation.
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


How does that order filters? With web.xml you can determine the order filters are called in, but I didn't see anything about that in the WebFilter annotation.


i also don't know how to do that with annotations, the only thing which i have tried is url-pattern.
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't played around with Servlets 3 any yet -- it's hard enough to get clients to use Tomcat 6, no way are they moving to 7 yet.

But, I think I read somewhere that if stuff like order is important, you need to fall back to using the deployment descriptor for those elements.
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you bear bibeault.
so to be short and precise, we can't do all things with annotations, which we can do with deployment descriptor..
also we can't do such things like security concerns (security roles etc), with annotations, i think..
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe that to be the case, but the Servlet Spec has the final say.
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay...
thank you...
 
Ranch Hand
Posts: 31
Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

@Rob: About the @WebFilter I think we can say the container through pro grammatically. else it is up to container to choose.(Any one Please correct me if I am wrong).

@paul: I started reading the servlet 3 spec. I believe the security concerns like(security roles) can be done through programming which I believe is the feature in servlet 3
 
Rob Spoor
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:But, I think I read somewhere that if stuff like order is important, you need to fall back to using the deployment descriptor for those elements.


I guess that makes sense. It's like specifying a global interceptor for EJBs. The only way to do that without adding the @Interceptors annotation to each and every EJB is to put it in the deployment descriptor.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic