Describe how you would configure a filter to initialize with predefined parameters.

  • Implement the init() method in the filter
  • Set parameters in the doFilter() method
  • Use a configuration file
  • Use the in the deployment descriptor
To configure a filter with predefined parameters, use the element in the deployment descriptor (web.xml) to specify initialization parameters. These parameters can be accessed in the filter using the getInitParameter() method.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *