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
- 요리
- Eclipse
- 디카페인
- Responsively app
- RefreshableSqlSessionFactoryBean
- 정민이초밥
- ORA-01745
- ORA-01005
- 은혜침구
- 맛집
- AbstractViewe
- 배딩작업
- Oracle
- docker
- 반응형앱
- 양동점
- SVN사용방법
- egov
- css
- JavaScript
- 광주
- mybatis
- Jsp Pagination
- ORA-01756
- 나주
- Java
- 문방구과자
- 루키초밥
- ORA-00909
- 카페
Archives
- Today
- Total
gnusraun
Egov @ResponseBody Ajax 설정 (404 Error 발생) 본문
728x90
초기 Egov 프레임워크를 이용하여 프로젝트를 생성하고 Ajax 통신할 경우 서버에서는 정상적으로 동작 하나
return page가 없어 404 Error가 발생
:: pom.xml
jackson dependency 추가
<dependency>
<groupid>com.fasterxml.jackson.core</groupid>
<artifactid>jackson-core</artifactid>
<version>2.8.8</version>
</dependency>
<dependency>
<groupid>com.fasterxml.jackson.core</groupid>
<artifactid>jackson-annotations</artifactid>
<version>2.8.8</version>
</dependency>
<dependency>
<groupid>com.fasterxml.jackson.core</groupid>
<artifactid>jackson-databind</artifactid>
<version>2.8.8</version>
</dependency>
:: dispatcher-servlet.xml
mvc:annotation-driven 추가
** 기존 egov프레임워크에서 사용하는 beans에서 xmlns:mvc , xsi:schemaLocation="*mvc*" (2개) 추가
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd"
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
<mvc:annotation-driven></mvc:annotation-driven>
...
:: Java
@ResponseBody 사용
@RequestMapping(value = "/subAdd.do")
@ResponseBody
public Map<string, object> subAdd() throws Exception{
Map map = new HashMap<string, object>();
map.put("AA", "1");
map.put("BB", "2");
return map;
}
728x90
'Backend > Egov' 카테고리의 다른 글
Egov org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement (0) | 2023.05.16 |
---|---|
Egov RefreshableSqlSessionFactoryBean 서버 재시작 없이 XML 반영 (0) | 2023.05.14 |
Egov 오라클 연동 (0) | 2023.05.13 |
Egov Scheduler 설정 (0) | 2023.05.13 |
Egov Pagination 페이지 처리 (0) | 2023.05.13 |