Spring

Spring MVC (스프링 웹 MVC) 강의 32 - @RestController와 한글출력 설정

지각생 2022. 1. 7. 23:29
728x90

 

@RestController를 하면

@ResponseBody 한것과 같은 효과가 난다.

한글이 깨짐

 

 

<mvc:annotation-driven>
	<mvc:message-converters> <!-- @ResponseBody로 String 처리할때 한글처리 -->
		<bean class="org.springframework.http.converter.StringHttpMessageConverter">
			<property name="supportedMediaTypes">
				<list>
					<value>text/html;charset=UTF-8</value>
				</list>
			</property>
		</bean>
	</mvc:message-converters>
</mvc:annotation-driven>

한글 잘 나옴

 

 

 

출처:

https://www.youtube.com/watch?v=aDjJXbv14LU&list=PLq8wAnVUcTFUHYMzoV2RoFoY2HDTKru3T&index=58 

 

728x90