1. spring-mvc.xml 아래 코드로 수정 합니다.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- @Controller 어노테이션을 이용한 컨트롤러를 사용하기 위한 설정 -->
<mvc:annotation-driven />
<!-- DispatcherServlet의 매핑 경로를 "/"로 주었을때, JSP/HTML/CSS 등을 올바르게 처리 하기 위한
설정 -->
<mvc:default-servlet-handler />
<!-- prefix="/WEB-INF/view/"은 forward 시킬때 "board/list.jsp" 라고 입력을 하면 실제적으로는
"/WEB-INF/view/board/list.jsp" 가 된다. suffix=".jsp" 로 지정하면 "board/list" 만
입력을 하면 실제적으로는 "board/list.jsp" 가 된다. prefix는 앞에 내용을 붙이는 것이고 suffix는 뒤쪽에 내용을
붙이는 것이다. -->
<mvc:view-resolvers>
<mvc:jsp prefix="/WEB-INF/view/" suffix=".jsp" />
</mvc:view-resolvers>
<!-- 자동 DI 적용 -->
<context:annotation-config />

</beans>
2. src/main/resources 우클릭 -> new -> Folder 선택











3. resources 선택 -> 폴더명 : mybaits 으로 생성 합니다




4. src/main/resources/mybatis 폴더에

boardDao.xml 파일 생성 합니다.



5. src/main/java 우클릭 -> new -> Class 선택하여 생성 합니다.


Package 명 : com.spring.board.controller

Class명 : BoardController



6. BoardController.java 아래 코드 작성

package com.spring.board.controller;
import org.springframework.stereotype.Controller;
@Controller
public class BoardController {

}//class BoardController


7. board.xml 아래 코드 작성
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="com.spring.board.controller.BoardController" />
</beans>


Posted by 홍이홍이
,