Link to home
Start Free TrialLog in
Avatar of Sathish David  Kumar N
Sathish David Kumar NFlag for India

asked on

how to add jar in another spring boot application

Hi

how to add jar in another spring boot application

I have created one spring application which contain filter i have created that application as a jar and include in another spring boot application .

but that filter is not working ?
jar in Maven dependency i added in pom file also . but it does not call the jar
Avatar of girionis
girionis
Flag of Greece image

1) Make sure your jar is in the classpath.
2) Make sure you have defined your filter by using a FilterRegistrationBean.
Avatar of Sathish David  Kumar N

ASKER

yes its in class path ..
I register  public FilterRegistrationBean < AuditFilter > filterRegistrationBean() {}

but spring boot does not undertsand and the filter never call
How do you register it? The filterRegistrationBean method body is empty.
@Bean
       public FilterRegistrationBean < AuditLoggingFilter > filterRegistrationBean() {
        FilterRegistrationBean < AuditLoggingFilter > registrationBean = new FilterRegistrationBean();
        AuditLoggingFilter requestAndResponseLoggingFilter = new AuditLoggingFilter();

        registrationBean.setFilter(requestAndResponseLoggingFilter);

        return registrationBean;
       }*/
}
Yes this is the correct way. Do you have it in comments (I see the */)?
ASKER CERTIFIED SOLUTION
Avatar of Sathish David  Kumar N
Sathish David Kumar N
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial