반응형
스프링부트에서 필터를 등록하는 방법입니다.
import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class WebMvcConfig extends WebMvcConfigurerAdapter { // ... @Bean public FilterRegistrationBean getFilterRegistrationBean() { FilterRegistrationBean registrationBean = new FilterRegistrationBean(new XSSFilter()); registrationBean.setOrder(Integer.MIN_VALUE); registrationBean.addUrlPatterns("/*"); return registrationBean; } // ... } |
반응형
'java' 카테고리의 다른 글
자바 - 리눅스에서 특정 프로세스 찾기. ps -ef command java on linux (2) | 2018.05.16 |
---|---|
java inputStream to String, read classpath file (0) | 2018.05.16 |
java byte substring (0) | 2018.05.15 |
pure java http client example (jdk 1.8) (0) | 2018.04.01 |
org.apache.catalina.util.SessionIdGeneratorBase : Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [289,555] milliseconds. (0) | 2018.03.21 |
spring boot application.properties encryption/decryption 스프링부트 프라퍼티 암호화 복호화 (0) | 2018.03.12 |
spring boot - spring.log 남기지 않기. (0) | 2018.02.21 |
java poi excel write 엑셀 쓰기 (0) | 2018.01.29 |