Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- big data
- java
- 자료구조
- Data Structure
- sort
- AWS
- 하둡
- 리눅스
- Amazon
- storage
- data
- 스프링
- 레드햇
- 도커
- docker
- 아마존
- 설치
- rhcsa
- 알고리즘
- 빅데이터
- Spring
- algorithm
- Redshift
- redhat
- recursive
- 자바
- linux
- 재귀
- 스토리지
- hadoop
Archives
- Today
- Total
Developer MJ
[Spring Soical] ConnectController 본문
WebMVC Controller와 비슷한 형태로 Spring Social에서 제공되는 /connect로 시작되는 URL 컨트롤러를
커스터마이징 하기 위해는 Extends하여 재작성할 필요가 있다.
- ConnectController Endpoints
- connectView를 Override하여 소셜미디어와 연결되지 않았을 때, 페이지를 Custom 할 수 있다.
- connectedView를 Override하여 소셜미디어와 연결되지 않았을 때, 페이지를 Custom 할 수 있다.
import org.springframework.social.connect.ConnectionFactoryLocator;
import org.springframework.social.connect.ConnectionRepository;
import org.springframework.social.connect.web.ConnectController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@CrossOrigin
@RequestMapping("/connect")
public class CustomConnectController extends ConnectController {
public CustomConnectController(ConnectionFactoryLocator connectionFactoryLocator,
ConnectionRepository connectionRepository) {
super(connectionFactoryLocator, connectionRepository);
// TODO Auto-generated constructor stub
}
@Override
protected String connectView(String providerId) {
return "redirect:/login";
}
@Override
protected String connectedView(String providerId) {
System.out.println("connected");
return "redirect:/facebook";
}
}
'Framework > Spring' 카테고리의 다른 글
[Spring Social] ProviderSignInController (0) | 2017.08.31 |
---|---|
[Spring Social] Social Configuration (0) | 2017.08.31 |
[MAVEN] Local Repository 등록 (OJDBC) (0) | 2017.07.26 |
[Spring] Spring & Eclipse 시작하기 part-2 (0) | 2017.02.07 |
[Spring] Spring & Eclipse 시작하기 part-1 (0) | 2017.02.04 |