When springBoot lets the interceptor, the interceptor object does not use the New interceptor object, but instead USES bean injection.
@Configuration
public class WebAppConfigurer implements WebMvcConfigurer {
@Autowired
private AuthorizationInterceptor authorizationInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(authorizationInterceptor).addPathPatterns("/**");
}
}
Read More:
- The @ Autowired annotation in springboot is invalid in ordinary classes. How to solve and use the null pointer exception java.lang.nullpointerexception
- Solution to null pointer error in array
- Failed to get the resources path in the jar package, reporting an error null pointer
- When the spring MVC project is running on idea, an error is reported when the controller is a null pointer
- Use of HQL query.list () is a null pointer exception, but the database can find out the result
- How to solve the problem of undefined layer
- To solve the problem of flashback of calling class function of glutsolidcube() in Win32 program
- After the go pointer is declared and assigned, a panic: runtime error: invalid memory address or nil pointer reference appears
- Java project cannot import entity class package and service package, controller layer reports error, fix project setup is OK
- org.apache.ibatis.type.TypeException: Error setting non null for parameter #4 with JdbcType null
- nt service 1072 No need to restart, repeat the method of installing the service program or service driver
- To solve the problem of C # calling excel interface error, prompt: the COM object of Microsoft. Office. Interop. Excel. Applicationclass is forcibly converted to the interface type “Microsoft. Offi”
- Git bash display error can not be used, how to solve
- How to Solve freemaker null Error
- Android solution to the conflict of calling ontouch and onclick at the same time
- How to Solve mybatis returns null when querying Oracle database with char type field
- How to solve the “specified service has been marked for deletion” error
- SqlNullValueException: Data is Null. This method or property cannot be called on Null values.
- How to use C + + function pointer array
- postman restricted header use postman interceptor