RestTemplate는 자동으로 URLEcoding을 해준다.


GET방식으로 아래 URL호출시에... 특수문자 '=' URLEncoding을 해줄필요가 없다..

RestTemplate에서느 자동으로 해준다. 


http://localhost:9999/test?param=test=


RestTemplate restTemplate = new RestTemplate();

String result = restTemplate.getForObject("http://localhost:9999/test?param=test=", String.class);


'java' 카테고리의 다른 글

Spring Filter 순서 설정.  (0) 2018.01.11
Json 응답시 Null값을 ""으로 자동으로 바꾸기.  (0) 2017.06.21
Spring RestTemplate timeout 설정  (0) 2016.05.30
log4j 설정  (0) 2016.04.06
JPA 사용시 특정 컬럼만 UPDATE 하는 방법..  (0) 2016.04.01
Posted by 무세1
,

맥북 한영 전환 : Command+Space

패러럴즈 한영 전환 단축키 : Alt


패러럴즈 한영 전환 단축키를 Command+Space로 변경하기.


1. 첫번째로 패러럴즈 설정 변경.

. 패러럴즈 설정->단축키->Windows7 선택.

. + 선택후에 

. 에서 : Cmd선택후 Space 클릭.

. (으)로 : AltGr 선택.


2. 맥북 설정 변경.

. 시스템 환경설정-> 키보드 -> 단축키 -> 입력소스.

. 이전입력소스선택을 alt+command_space로 변경.

. 입력메뉴에서 다음소스 선택을 command_space로 변경.

. 모든컨토롤 선택.


이렇게 변경하면 패러럴즈에서 Command+Space로 한영 전환을 할 수 있다.

Posted by 무세1
,

RestTemplate 생성 시 Timeout 설정 방법.


// Connection Timeout 10초, ReadTimeout 10초 설정.

private RestTemplate getRestTemplate() {
HttpComponentsClientHttpRequestFactory factory 

= new HttpComponentsClientHttpRequestFactory();
factory.setConnectTimeout(10*1000);
factory.setReadTimeout(10*1000);
RestTemplate restTemplate = new RestTemplate(factory);
return restTemplate;
}



Posted by 무세1
,