middlemoon
+SpringMVC + Batis (Model + View + Controller) 본문
조건
http://localhost8080/test/memberlist
membermybatiscontroller
membermybatis.jsp

DispatcherServlet 에서 -> servlet-context.xml(mvc관련)을 읽어갈것 !!

스프링과 마이바티스를 연결하는 설정파일
classpath는 중복파일로 되면 충돌이 일어난다 그러므로 annotation/memberservice/member.xml 삭제
즉 spring-mybatis.xml은 DispatcherServlet 과 servlet-context.xml을 모두 읽어야한다.


servlet-context.xml (MVC구조에서 사용)에 추가로 해주어야한다. - Controller (지금 내가 작업하고자 하는 패키지부분을)
spring-context.xml (Main에서의 사용)
이제는 controller 파일과 jsp 파일의 mvc파일의 구조를 만들어야한다.
get 방식과 set방식을 모두 불러내는 RequestMapping 형식 작성
모든 과정은 Service로 부터 시킴받아서 dao -> sqlSession session을 받는다. -> sql-mapping.xml 에서 memberlist 확인.

'Develop > Springboot' 카테고리의 다른 글
| java.lang.NumberFormatException: For input string: "undefined" Error:500 (0) | 2022.09.30 |
|---|---|
| Springboot4 설정부터 DB연동까지 (0) | 2022.09.12 |
| Spring + Mybatis 연동예제1 (0) | 2022.08.22 |
| error404 :Tomcaterror/JSP is not found, not available (0) | 2022.08.21 |
| Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: (0) | 2022.08.19 |
Comments