• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Filters Basic Functionality

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
4. totally different response
 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is so correct.....thanks for the clarification man
 
Ranch Hand
Posts: 502
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic