SSM 프레임 워 크 + maven 통합 구축
8169 단어 Spring
org.apache.struts
struts2-core
2.5.1
org.mybatis
mybatis
3.2.1
org.springframework
spring-context
3.2.18.RELEASE
org.springframework
spring-test
3.2.18.RELEASE
test
org.springframework
spring-core
3.2.18.RELEASE
org.springframework
spring-web
3.2.18.RELEASE
org.springframework
spring-aop
3.2.18.RELEASE
aspectj
aspectjweaver
1.5.4
org.springframework
spring-tx
3.2.18.RELEASE
org.springframework
spring-jdbc
3.2.18.RELEASE
org.springframework
spring-orm
3.2.18.RELEASE
org.apache.struts
struts2-spring-plugin
2.3.33
org.mybatis
mybatis-spring
1.3.1
commons-dbcp
commons-dbcp
1.4
commons-pool
commons-pool
1.6
s2
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
s2
/*
org.springframework.web.context.ContextLoaderListener
contextConfigLocation
classpath:/com/yufan/util/applicationContext.xml
웹. xml 에 추가 할 코드 주: 원래 my batis - configxml 의 설정 은 별명 속성 을 설정 하 는 것 을 제외 하고 다른 설정 정 보 는 모두 spring 설정 파일 로 이동 하 였 습 니 다.
다음은 spring 의 프로필 applicationContext. xml 의 내용 을 구체 적 으로 소개 합 니 다.
1.
2.
${driver}
${url}
root
${password}
3. sqlSession Factory 공장 설립
mapperLocation mapper 의 xml 맵 파일
type: Aliases 패키지 실체 클래스
4. dao 층 에 트 랜 잭 션 제어 추가 (정례 화)
dao 는 인터페이스 여야 합 니 다.
공장 설정 에 따라 맵 파일 을 자동 으로 연결 하여 정례 화 합 니 다.
사용 방법:
ApplicationContext applicationContext = new
ClassPathXmlApplicationContext("/com/yufan/util/applicationContext.xml");
UserDao userDao = (UserDao)applicationContext.getBean("userDao");
User u = new User(1, "yufan","yufan", true,20);
userDao.saveUser(u);
System.out.println(" ");
5. 트 랜 잭 션 제어
6. 서비스 층
7. action 층
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
[MeU] Hashtag 기능 개발➡️ 기존 Tag 테이블에 존재하지 않는 해시태그라면 Tag , tagPostMapping 테이블에 모두 추가 ➡️ 기존에 존재하는 해시태그라면, tagPostMapping 테이블에만 추가 이후에 개발할 태그 기반 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.