How can a filter access initialization parameters set in the web.xml file?
- Initialization parameters cannot be accessed by filters
- Using the FilterConfig object
- Using the HttpServletRequest object
- Using the ServletContext object
A filter can access initialization parameters set in the web.xml file through the FilterConfig object, which is passed to the init() method of the filter. The getInitParameter() method of FilterConfig can be used to retrieve the parameter values.
Loading...
Related Quiz
- In a distributed system, when two databases must be updated as part of a single transaction, which transaction management technique is most appropriate?
- How can you retrieve a servlet's initialization parameters in the init method?
- What is the difference between 'dirty read' and 'non-repeatable read' in the context of transaction isolation levels?
- A cookie's security can be enhanced by setting the _________ flag, which prevents its access via JavaScript.
- The listener interface _________ is used to listen for request attribute changes.