Forums Register Login

FilterConfig object...

+Pie Number of slices to send: Send
Hi there, I'm taking the exam next thursday and I am now doing my final revision. I have a question about Filters... I noticed that an init method that receives a FilterConfig object is required in a filter class... It says in the HF book that we use it to save the config object for later...

In the mock exam of the chapter, it says that Filters cannot reeive initialisation parameters like servlets do...

So my question is what is this filterConfig object for? What does it contain? How do you initialise it?

Your help will be greatly appreciated!

Alex
+Pie Number of slices to send: Send
Hi,
Filter can receive initialization parameters by calling FilterConfig.getInitParameter(). You can specify the initialization parameters same as you specify it for servlets. One can get ServletContext object also.

Hope that helps.


Sawan
Thanks tiny ad, for helping me escape the terrible comfort of this chair.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 398 times.
Similar Threads
Tomcat 4.0 problem with Filter class
Is filters part of the syllabus?
Filters and Design Pattens
setting request header
how much weightage does filter topic have in SCWCD?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:02:31.