Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletRequestListener

 
bnkiran kumar
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

What error are you seeing?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by bnkiran kumar:
... was that concept removed as now filters are introduced,?...


No, the two are not competing concepts.
 
bnkiran kumar
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ben/Paul thank you for your replies, my tomcat version is 4, i will try with tomcat 5.0
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic