Sathish David Kumar N
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
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
ASKER
yes its in class path ..
I register public FilterRegistrationBean < AuditFilter > filterRegistrationBean() {}
but spring boot does not undertsand and the filter never call
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.
ASKER
@Bean
public FilterRegistrationBean < AuditLoggingFilter > filterRegistrationBean() {
FilterRegistrationBean < AuditLoggingFilter > registrationBean = new FilterRegistrationBean();
AuditLoggingFilter requestAndResponseLoggingF ilter = new AuditLoggingFilter();
registrationBean.setFilter (requestAn dResponseL oggingFilt er);
return registrationBean;
}*/
}
public FilterRegistrationBean < AuditLoggingFilter > filterRegistrationBean() {
FilterRegistrationBean < AuditLoggingFilter > registrationBean = new FilterRegistrationBean();
AuditLoggingFilter requestAndResponseLoggingF
registrationBean.setFilter
return registrationBean;
}*/
}
Yes this is the correct way. Do you have it in comments (I see the */)?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
2) Make sure you have defined your filter by using a FilterRegistrationBean.