aspose file tools*
The moose likes Servlets and the fly likes ServletRequestListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "ServletRequestListener" Watch "ServletRequestListener" New topic
Author

ServletRequestListener

bnkiran kumar
Ranch Hand

Joined: Mar 02, 2006
Posts: 176
I am following Head first Servlet/ Jsp book, in that it is mentioned we can track request by using ServletRequestListener, but when i am using it , i am getting error.

was that concept removed as now filters are introduced, any body has any idea...


Kiran Kumar.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


but when i am using it , i am getting error.

What error are you seeing?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by bnkiran kumar:
... was that concept removed as now filters are introduced,?...


No, the two are not competing concepts.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
bnkiran kumar
Ranch Hand

Joined: Mar 02, 2006
Posts: 176
I am getting error , like class not found

i am including javax.servlet.* and javax.servlet.http.*


is it still there or it is removed...
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

javax.servlet.* and javax.servlet.http.* are packages in the JEE SDK. If you are using Tomcat look in its libs for servlet-api.jar. This will need to be in your classpath to compile your code.
bnkiran kumar
Ranch Hand

Joined: Mar 02, 2006
Posts: 176
Hi Paul thanks for you replies, i will not be able to run my application with our servlet.jar in my classpath, it is there, i am able to use other listeners like HttpSessionListener etc but i am not able to use ServletRequestListener, have you ever used it, if so can you paste the code...
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Pasting code is not going to help, bnkiran kumar. You need to make sure your environment is set up correctly. ServletRequestListener became part of the API for servlet version 2.4. That means your version of Tomcat must be 5.5 or higher. Which version are you using?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Paul Sturrock:
That means your version of Tomcat must be 5.5 or higher.


Minor correction:
Tomcat 5.0 supports Servlet Spec 2.4 as well.
bnkiran kumar
Ranch Hand

Joined: Mar 02, 2006
Posts: 176
Hi Ben/Paul thank you for your replies, my tomcat version is 4, i will try with tomcat 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ServletRequestListener