This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes ContextLoaderListener vs Filter for Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "ContextLoaderListener vs Filter for "/*"" Watch "ContextLoaderListener vs Filter for "/*"" New topic

ContextLoaderListener vs Filter for "/*"

arul meh

Joined: Sep 19, 2009
Posts: 27
I am wondering what is the sequence of execution in a web based project -

1) A java class which implements "ContextLoaderListener"

2) A class which acts as a filter and is maped for /*

In my case, I see that first ContextLoaderListener is called first, but before ALL the statements are executed in "contextInitialized" method, I see some methods from "filter" java class getting executed. Can anybody explain me - how request is being processed ?

Ankit Garg

Joined: Aug 03, 2008
Posts: 9280

ContextLoaderListener is not a part of SCWCD objectives. Are you talking about Spring framework??

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: ContextLoaderListener vs Filter for "/*"
Similar Threads
using filters with struts
Caching rendered html in jsp
Servlet Request Events and Listeners.
java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener