This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Filters Basic Functionality Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Filters Basic Functionality " Watch "Filters Basic Functionality " New topic
Author

Filters Basic Functionality

ramya ray
Ranch Hand

Joined: Aug 11, 2006
Posts: 101
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

Joined: Nov 28, 2006
Posts: 292
4. totally different response


Turn on, tune in, drop out.
Manikandan Jayaraman
Ranch Hand

Joined: Sep 15, 2004
Posts: 230
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.


Regards,<br />Mani<br />SCJP 1.4 (95%)<br />SCWCD 1.4 (94%)
Sayak Banerjee
Ranch Hand

Joined: Nov 28, 2006
Posts: 292
That is so correct.....thanks for the clarification man
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

All the four can be done using filter.



Can you give us link from which mock up exam you got this question?


Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
Sayak Banerjee
Ranch Hand

Joined: Nov 28, 2006
Posts: 292
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

Joined: Aug 11, 2006
Posts: 101
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Filters Basic Functionality