Spring Framework
Spring Security
- 스프링 시큐리티 사용 준비
- UserDetail - 스프링 시큐리티가 사용할 수 있는 User 객체 만들기
- 현재 로그인 한 사용자 정보 가져오기
- SecurityContextHolder를 이용하는 법
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String name;
if (principal instanceof UserDetails) {
name = ((UserDetails)principal).getUsername();
} else {
name = principal.toString();
}
- Spring dependency injection을 이용하는 법
public String write(@RequestParam("title") String title, @RequestParam("contents") String contents, Model model, Principal principal) {
...
page.edit(contents, userRepository.get(principal.getName()));
...
}
Hibernate
- ORM(Object Relation Mapping) 프레임워크. Java persistence, EJB3.0을 같이 알면 좋다.
- Lisence : LGPL
JSP
Markdown
- 위키 문법을 별도로 정의하고 파서를 구현하는 대신 Markdown을 사용하기로 결정했다.
- Markdown이란 : wiki:Markdown
- 위키피디아를 참고하여 Java로 구현된 Markdown implementation 중 Pegdown을 선택했다.
- MarkdownJ, MarkdownPapers는 문서가 부실하고 남은 두 구현체 중 Pegdown이 위키 제목을 통한 페이지 링크를 더 간편하게 지원해서.
- 아주 간단한 Pegdown 사용 예
- pom.xml에 dependency 추가하기
<dependency>
<groupId>org.pegdown</groupId>
<artifactId>pegdown</artifactId>
<version>1.1.0</version>
</dependency>
- markdown text를 html 문자열로 변환
String html = new PegDownProcessor().markdownToHtml(markdown text);
CGLIB
- CGLIB는 코드 생성 라이브러리로서(Code Generator Library) 런타임에 동적으로 자바 클래스의 프록시를 생성해주는 기능을 제공(펌) 이라고 한다.