GeeCON Prague 2014*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes listeners declaration: before or after servlet ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "listeners declaration: before or after servlet ?" Watch "listeners declaration: before or after servlet ?" New topic
Author

listeners declaration: before or after servlet ?

Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Hi,
I am reading contradictory things, and it is confusing me :
in version 2.4 of the servlets specification, do i have to declare listeners
before servlets in my description file web.xml ?
Does the order still matter ? Can it be before and after too ?

So, is this code correct ?


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Chethan Verma
Greenhorn

Joined: Oct 30, 2006
Posts: 18
Hi Max,

servlet2_4 spec says
The sub elements under web-app can be in an arbitrary order in this version of
the specification
.
means order doesn't matter right?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Yep, as Chethan says, order does not matter.


[My Blog]
All roads lead to JavaRanch
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

ok, thanks for your feedback, that's what I read too but i still was not sure. I guess the contradictory comments I read referred to different servlets specifications versions.

Does anyone know the important tags in the SCWCD exam where order still matters though ?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Forget about 2.3, and focus on 2.4. The order of elements in web.xml does not matter.
I've already discusses in another thread that the order of listeners and the order of filters is still important :
http://www.coderanch.com/t/173372/java-Web-Component-SCWCD/certification/order-elements-web-xml
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: listeners declaration: before or after servlet ?