題目提到「SSI 框架」,推測為 SSH(Struts2 + Spring + Hibernate) 或 SSM(Spring + SpringMVC + MyBatis) 的筆誤。以下按經典 SSH 為例,SSM 同理。
| 模塊 | 關鍵 JAR(Group:Artifact:Version) | 說明 |
|---|---|---|
| Spring | org.springframework:spring-context:5.3.x org.springframework:spring-webmvc:5.3.x org.springframework:spring-orm:5.3.x org.springframework:spring-tx:5.3.x org.springframework:spring-jdbc:5.3.x |
核心容器、Web MVC、ORM 整合、事務、JDBC 模板 |
| Hibernate | org.hibernate:hibernate-core:5.6.x org.hibernate:hibernate-entitymanager:5.6.x org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.x |
ORM 核心、JPA 實現、JPA API |
| Struts2 | org.apache.struts:struts2-core:2.5.x org.apache.struts:struts2-spring-plugin:2.5.x org.apache.struts:struts2-json-plugin:2.5.x |
MVC 核心、Spring 整合插件、JSON 結果支持 |
| 數據庫/連接池 | com.zaxxer:HikariCP:5.0.x mysql:mysql-connector-java:8.0.x |
高性能連接池、MySQL 驅動 |
| 工具/日誌 | commons-logging:commons-logging:1.2 org.slf4j:slf4j-api:2.0.x ch.qos.logback:logback-classic:1.4.x com.fasterxml.jackson.core:jackson-databind:2.15.x |
日誌門面、Logback 實現、JSON 序列化 |
ContextLoaderListener(加載 Spring 容器)、StrutsPrepareAndExecuteFilter(Struts2 入口)、字符編碼過濾器。<tx:annotation-driven/><context:component-scan base-package="com.xxx"/> 掃描 Service/Dao<constant name="struts.objectFactory" value="spring"/> 交由 Spring 管理 Actionstruts-default、json-defaultsrc/
├── main/
│ ├── java/
│ │ └── com/xxx/
│ │ ├── action/ (Struts2 Action)
│ │ ├── service/ (業務邏輯接口+實現)
│ │ ├── dao/ (數據訪問接口+實現)
│ │ ├── model/ (實體類/POJO)
│ │ └── util/ (工具類)
│ ├── resources/
│ │ ├── applicationContext.xml
│ │ ├── struts.xml
│ │ ├── hibernate.cfg.xml
│ │ ├── logback.xml
│ │ └── jdbc.properties
│ └── webapp/
│ ├── WEB-INF/
│ │ └── web.xml
│ ├── jsp/ (視圖頁面)
│ └── static/ (css/js/images)
└── test/
└── java/ (單元/集成測試)