본문 바로가기

Programing/Struts

0730_Struts2 게시판 ibatis-struts2

사용자 삽입 이미지


1.action을  server단에서  처음으로 받는 것은 Filter Dispatcher가 받고 web.xml에서 설정한다.
2.배치관리자(configuration Manager)에 의해 struts.preperties ,struts.xml 이것들이 로드된다.
3.action 인보케이션에서 인터셉터를 호출하고 다시 리턴되고다시 인터셉터2를 호출하고
다시 리턴되고 다음에 액션을호출하고 다시 리턴되고 다시 리절트..에서 다시 올라간다..
*Struts.xml에는 각 Action 정의.

Bbs.java<인터페이스>
BbsImpl.java<구현객체> 두개는 dao.xml에 연결된다.

DaoService(싱글턴)는 dao.xml과 연결되어있고 dao.xml은 sqlconfig.xml과 연결되어있고
sqlconfig.xml은 Datasource(oracle)와 sqlMap이 연결 sqlMap과 Bbs.xml이 연결
dao.xml이 가장 중요

*action에서 daoService를 불러서 연결하면된다.(DaoService.getDao(Bbs.class))dao객체를 반환.Bbs가 나온다. b.getAllBbs()이걸호출하면 결국 인터페이스가 아니라 구현객체(BbsImpl.java)가 호출된다