• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Filters Basic Functionality

 
ramya ray
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What function filters don�t apply when request comes in :
1. Security Check
2. Audit Check
3. Header Modification
4. totally different response

Please reply.

Thanks,
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
4. totally different response
 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sayak, We can very well give a different response to the client using filters. When a request comes in, we can very well skip the chain.doFilter and render a different response all together.

Request doesn't have any methods like setHeader and thus modifying the request headers is not possible.
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is so correct.....thanks for the clarification man
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All the four can be done using filter.



Can you give us link from which mock up exam you got this question?
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well Prabhu...here are my thoughts on this....when you say all 4 are possible that's partially true....not completely....

If you look at the 3rd option....you may think that it can made possible by extending the HttpServletRequestWrapper class, wrapping the original request, modifying the request headers and passing it on to the chain.doFilter() method....right? But, think about this, can the request header values be actually changed?...all you can do is provide implementations of getHeader(), getHeaders(), etc. which would return different values for those headers...so it would seem as if the headers have been modified...I mean you don't have a setHeader() in HttpServletRequestWrapper....do you?

Please correct me if I've gone wrong somewhere because I want to be sure that I know the right thing....Please post your thoughts on this....I would really appreciate it....Thanks in advance
[ December 26, 2006: Message edited by: Sayak Banerjee ]
 
ramya ray
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually it was shared within my group so i am not sure from which mock exam they pick it.

Thank you all for giving such valuable comments.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic