Posted
Filed under JSP, JAVA
[참고]https://github.com/naver/lucy-xss-servlet-filter
pom.xml 추가
<dependency>
<groupId>com.navercorp.lucy</groupId>
<artifactId>lucy-xss-servlet</artifactId>
<version>2.0.0</version>
</dependency>

 

[web.xml]
filter 순서 UTF-8 인코딩 필터가 있다면 그 다음으로
multipartFilter  추가 후 XSS filter 추가 한다.
이유) 게시판 파일 업로드  enctype="multipart/form-data"
일떄 multipartFilter 필터 타지 않을 수 있음 그래서 필터 순서를 맞춰줘야 함

<!-- multipartFilter -->
<filter>
<filter-name>multipartFilter</filter-name>
<filter-class>
org.springframework.web.multipart.support.MultipartFilter
</filter-class>
</filter>

<filter-mapping>
<filter-name>multipartFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!-- xss filter -->
<filter>
<filter-name>xssEscapeServletFilter</filter-name>
<filter-class>com.navercorp.lucy.security.xss.servletfilter.XssEscapeServletFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>xssEscapeServletFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

[root-context.xml]에  multipartResolver   bean설정시 아이디를
multipartResolver --> filterMultipartResolver 변경 해줌
그래야 xss 필터가 정상적으로 동작

<!-- multipartResolver -->
<!--<beans:bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />-->
<beans:bean id="filterMultipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />

2019/01/30 18:55 2019/01/30 18:55
Posted
Filed under JSP, JAVA
xml설정
xmlns:task="http://www.springframework.org/schema/task"

xsi:schemaLocation 부분에 
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-4.0.xsd

추가
<task:annotation-driven /> 추가



==================================================

1초마다 한번식 실행

@Service
public class VisitorConfig {
@Scheduled(fixedDelay = 1000)
public void visitor(){
System.out.println("test:");
}
}
2019/01/28 11:17 2019/01/28 11:17
Posted
Filed under JSP, JAVA
[원문]
http://krams915.blogspot.com/2010/12/spring-security-mvc-querying.html @Resource(name="sessionRegistry") private SessionRegistryImpl sessionRegistry; for (Object username: sessionRegistry.getAllPrincipals()) { logger.debug(username); }
2019/01/14 12:08 2019/01/14 12:08