0

I have a third party jar which has a filter say XYZFilter. Usual way specified to configure this JAR in applications is to make a fresh entry in web.xml with XYZFilter which will invoke the filter. Later, we can consume APIs exposed by this JAR like - NewUser user = XYZFilter.getData(httpRequest).

However, we dont have a web.xml in our Spring application.

If someone can point high level steps on how can I consume getData() in this JAR?

user3310534
  • 19
  • 1
  • 4
  • Is it a Spring Boot app? I presume other similar components are used as Beans. Do you see dependency for the library in you `pom.xml` if there is one? – Dropout Sep 28 '20 at 11:36
  • It is not a Spring Boot app, so no @Beans present. It is a new library I want to consume, I can add its dependency in pom.xml. – user3310534 Sep 29 '20 at 04:21
  • ok try that.. that should enable you to use it's contents.. there shouldn't be any issues but if there are, just let me know what the error is – Dropout Sep 30 '20 at 06:23
  • In spring you can import and register you 3rd party filter using FilterRegistrationBean. Define FilterRegistrationBean bean in your boot app and create an object of frb and just add "XYZFilter" as frb.setFilter(new XYZFilter()); You can add params and url pattern too. – Roopesh Payyanath Jun 14 '22 at 10:22

0 Answers0