This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Listeners Vs Filter

 
Santosh Kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have 8 Listeners. I am concerned with ServletRequestListener.

I think both the filter and request listener is working similarly. So which is the best.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

The difference is that the filter has access to the servlet response (in addition to the servlet request), and can actually alter both request and response.

The request listener is really just a notification mechanism - it can't be used to change the request processing.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Santosh.Kumar RSI:
We have 8 Listeners. I am concerned with ServletRequestListener.

I think both the filter and request listener is working similarly. So which is the best.


Howdy "Santosh.Kumar RSI",

Welcome to JavaRanch

Kindly adjust your display name according to the ranch's naming policy.

You can do so by editing your profile.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic