struts-jsp-migration
Migration assessment and patterns for Struts/JSP to Spring Boot. Component mapping, risk analysis, incremental migration strategy.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Migration assessment and patterns for Struts/JSP to Spring Boot. Component mapping, risk analysis, incremental migration strategy.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Manage project board — issues, sprints, status tracking, acceptance verification, and release management. Supports GitHub Projects, Jira, and YouTrack via pluggable providers.
Manage project board — issues, sprints, status tracking, acceptance verification, and release management. Supports GitHub Projects, Jira, and YouTrack via pluggable providers.
Happy path smoke testing — navigates all configured endpoints, checks HTTP status and server logs for errors, and optionally auto-creates GitHub issues for failures. Config-driven via CC_SMOKE_TEST_* variables.
Manage GitHub Project board — issues, sprints, status tracking, acceptance verification, and release management. White-labeled template for any project.
Check for and apply cognitive-core framework updates. Compares installed agents, skills, and hooks against the framework source, shows available updates, and safely applies them.
Check for and apply cognitive-core framework updates. Compares installed agents, skills, and hooks against the framework source, shows available updates, and safely applies them.
| name | struts-jsp-migration |
| description | Migration assessment and patterns for Struts/JSP to Spring Boot. Component mapping, risk analysis, incremental migration strategy. |
| user-invocable | false |
| allowed-tools | Read, Grep, Glob |
| catalog_description | Struts/JSP to Spring Boot migration — assessment, component mapping, incremental strategy. |
Before migrating, score each dimension:
| Dimension | Score 1-5 | Weight | Questions |
|---|---|---|---|
| Test coverage | 3x | What % of Actions have tests? Are there integration tests? | |
| Code complexity | 2x | Average Action size? Cyclomatic complexity? God classes? | |
| Database coupling | 2x | Direct JDBC? Hibernate version? Stored procedures? | |
| External integrations | 2x | SOAP services? JMS? Custom protocols? | |
| JSP complexity | 1x | Scriptlet density? Custom tag libraries? | |
| Team readiness | 1x | Spring Boot experience? Training needed? |
Total = sum(score x weight) / sum(weights). Below 2.5 = high risk, 2.5-3.5 = medium, above 3.5 = favorable.
| Struts 1.x | Struts 2.x | Spring Boot |
|---|---|---|
Action.execute() | ActionSupport.execute() | @Controller + @RequestMapping method |
ActionForm | POJO properties | @RequestBody DTO or @ModelAttribute |
ActionForward | return "success" | return "viewName" or ResponseEntity |
ActionMapping | struts.xml <action> | @GetMapping("/path") |
DispatchAction | method attribute | Multiple @RequestMapping methods |
ActionServlet | StrutsPrepareAndExecuteFilter | DispatcherServlet (auto-configured) |
| Struts | Spring Boot |
|---|---|
ActionForm.validate() | @Valid + Bean Validation (@NotNull, @Size) |
validation.xml (Commons Validator) | @Validated groups |
<html:errors/> | BindingResult + error view |
Struts 2 *-validation.xml | Same Bean Validation annotations |
| JSP/Struts Tags | Spring Boot Options |
|---|---|
<html:form> | Thymeleaf <form> or REST API + SPA |
<bean:write> | ${variable} (Thymeleaf/EL) |
<logic:iterate> | <c:forEach> → Thymeleaf th:each |
<logic:present> | <c:if> → Thymeleaf th:if |
<tiles:insert> | Thymeleaf layouts or fragments |
<s:property> | ${property} |
<s:iterator> | Thymeleaf th:each |
| Custom tag libraries | Thymeleaf dialects or components |
| Legacy | Spring Boot |
|---|---|
web.xml | Auto-configuration (embedded Tomcat) |
struts-config.xml | @Configuration + component scanning |
tiles-defs.xml | Thymeleaf layout dialect |
log4j.properties | application.yml + Logback |
hibernate.cfg.xml | spring.jpa.* properties |
context.xml (JNDI DataSource) | spring.datasource.* properties |
applicationContext.xml (Spring XML) | @Configuration classes |
| Legacy Pattern | Spring Boot |
|---|---|
Raw JDBC + Connection | Spring JdbcTemplate or Spring Data JPA |
Hibernate 3 SessionFactory | Spring Data JPA + EntityManager |
iBatis SqlMapClient | MyBatis-Spring or Spring Data JPA |
| DAO pattern (manual) | Spring Data Repository interfaces |
| JNDI DataSource | spring.datasource.jndi-name or direct config |
[Existing WAR] [New Spring Boot App]
├── Struts Actions (existing) ├── @RestController (new APIs)
├── JSPs (existing) ├── spring-boot-starter-web
├── web.xml ├── application.yml
└── struts-config.xml └── Reverse proxy routes new paths
struts-config.xml@Service classes usable by bothTwo options:
For Option B (recommended for new development):
@RestController)| Risk | Mitigation |
|---|---|
| Data migration failures | Same database — no data migration needed |
| URL contract breaks | Map all URLs before migration, use @RequestMapping to preserve paths |
| Session management differences | Use Spring Session with same backing store (Redis/JDBC) |
| Authentication changes | Extract auth to shared filter/interceptor early |
| Reporting/batch jobs break | These often bypass Struts — migrate independently |
| Performance regression | Load test each migrated module before switching traffic |
| CVE | Version | Issue | Fix |
|---|---|---|---|
| CVE-2017-5638 | Struts 2.x | Remote code execution via Content-Type | Upgrade or migrate |
| CVE-2018-11776 | Struts 2.x | RCE via namespace/action resolution | Upgrade or migrate |
| CVE-2020-17530 | Struts 2.x | OGNL injection via tag attributes | Upgrade or migrate |
| S2-045 through S2-066 | Struts 2.x | Various RCE/injection vectors | Upgrade or migrate |
If the Struts version is end-of-life, migration priority is CRITICAL — these are actively exploited.