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 |
Tags
- spring repository
- spring mapper annotation
- JPA DB 다중 Connection
- spring JPA DB multi Connection
- spring JPA DB Connection
- 도커 로그 확인
- Vue
- 자바버그수정
- 도커 컨테이너 로그
- Spring
- mapper annotationo
- vueslot
- 도커 logs
- AllArgsConstructor
- NoArgsConstructor
- docker 로그
- Spring JPA Specification
- @Builder @NoArgsConstructor
- JpaRepository update
- repository annotation
- JPA DB Connection 다중
- spring @mapper
- vuecomponent
- spring DB Connection
- spring mapper
- doker logs tail
- Transactions Propagation Option
- Data Annotation
- CrudRepository update
- JAVA Exception 종류
Archives
- Today
- Total
개발을 잘하고 싶은 개발자
jsonView InternalResourceViewResolver 설정,velocity( Spring 4, IntelliJ) 본문
Backend/maven
jsonView InternalResourceViewResolver 설정,velocity( Spring 4, IntelliJ)
_소피아 2016. 3. 18. 14:33다른 블로그에서는 분명
< bean class = "org.springframework.web.servlet.view.BeanNameViewResolver" id = "viewResolver" p:order = "0" > |
2 |
< bean class = "org.springframework.web.servlet.view.json.MappingJacksonJsonView" id = "jsonView" > |
3 |
< property name = "contentType" value = "application/json;charset=UTF-8" > |
4 |
</ property ></ bean > |
5 |
</ bean > |
이렇게 사용하라고 했지만
결론은...
HTTP Status 500 - Servlet.init() for servlet bbs threw exception
500에러가 발생한다
그 이유는
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
dependency를 넣지 않아서도 아니고
<bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
<property name="resourceLoaderPath" value="/WEB-INF/vm/"/>
</bean>
<bean id="velocityViewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
<property name="suffix" value=".vm"/>
</bean>
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" id="viewResolver"/>
<bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView" id="jsonView">
<property name="contentType" value="application/json;charset=UTF-8">
</property>
</bean>
왠지 velocity와 같이 사용해서 인 것같다....
그래서 다른블로그들 말만 믿고 에러만 쳐다보다가
결국 찾은 ViewResolver가 바로
<bean id="beanNameResolver" class="org.springframework.web.servlet.view.BeanNameViewResolver"/>
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"/>
바로 InternalResourceViewResolver
이 분이다. 에러는 커녕 너무 잘 돌아가줘서 고맙다
'Backend > maven' 카테고리의 다른 글
맥 인텔리제이 메이븐 벨로씨티 프로젝트 mac intellij maven velocity project (0) | 2016.01.22 |
---|