티스토리 뷰

Study

maven(메이븐) JSON(제이슨) 설정

메디츠 2024. 1. 20. 13:53
반응형

16년 4월 기준.

 

pom.xml

 

<!-- json -->

<dependency>

<groupId>org.codehaus.jackson</groupId>

<artifactId>jackson-core-asl</artifactId>

<version>1.8.0</version>

<type>jar</type>

<scope>compile</scope>

</dependency>

<dependency>

<groupId>org.codehaus.jackson</groupId>

<artifactId>jackson-mapper-asl</artifactId>

<version>1.8.0</version>

<type>jar</type>

<scope>compile</scope>

</dependency>

<dependency>

<groupId>org.codehaus.jackson</groupId>

<artifactId>jackson-xc</artifactId>

<version>1.8.0</version>

<type>jar</type>

<scope>compile</scope>

</dependency>

 

web-servlet.xml

< bean

class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">

<property name="messageConverters">

<list>

<ref bean="jsonConverter" />

<!--

<ref bean="marshallingConverter" />

<ref bean="atomConverter" />

-->

</list>

</property>

</bean>

<bean id="jsonConverter"

class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">

<property name="supportedMediaTypes" value="application/json" />

</bean>

 

정상적인 주입이 안될때 프로젝트 클린 또는 project java EE Module Depencies 체크 해제후 다시 체크 -- 서버 재실행

반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2025/07   »
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
글 보관함