AGENT SKILL

pr-review

Review of a PR, branch, or your own uncommitted work across eight dimensions — security, correctness, test coverage, API/compatibility, usability, documentation, code quality, performance. Sizes the diff, reviews inline or fans out reviewers off a shared brief, verifies findings against code, reports a grouped list with a shape verdict, fixes on approval. Use for "review this PR", "/pr-review 3011", or a pre-flight self-review before submitting; add "thorough" for adversarial verification.

License 许可
Apache-2.0
所属仓库
apache/tika
最近更新
2026-11-10
Stars
★ 4.1k
Forks
1.0k

01 前言 Front Matter

name
struts-to-spring
description
Migration guideline for transforming Apache Struts 2 applications to Spring Boot 3.x and Spring MVC.

02 资源文件 6

03 SKILL.md 正文

Struts 2 to Spring Boot 3.x Migration Guideline

Metadata

  • Source Technology: Apache Struts 2 (struts2-core)
  • Target Technology: Spring Boot 3.x with Spring MVC
  • Trigger Keywords: struts, struts2, ActionSupport, struts.xml, xwork2, opensymphony, struts-tags
  • Version: 1.0.0
  • Last Updated: 2025-01-22

Overview

This guideline provides comprehensive skills for migrating Apache Struts 2 applications to Spring Boot 3.x. Each skill addresses a specific migration concern with concrete transformation rules, examples, and validation criteria.

Skill Files

File Skills Description
SKILL-config.md migrate-maven-dependencies, create-spring-boot-application, create-application-properties Project setup and configuration
SKILL-action.md convert-action-to-controller, convert-action-properties Action to Controller conversion
SKILL-view.md convert-jsp-tags, convert-ognl-to-el, convert-result-types View layer migration
SKILL-interceptor.md convert-interceptor, convert-validation Interceptors and validation
SKILL-xml.md migrate-struts-xml, migrate-web-xml XML configuration migration
SKILL-test.md convert-test-classes, create-exception-handler Testing and exception handling

Migration Checklist

Execute skills in this order:

Phase 1: Project Setup

  1. [ ] migrate-maven-dependencies - Update pom.xml (SKILL-config.md)
  2. [ ] create-spring-boot-application - Create main class (SKILL-config.md)
  3. [ ] create-application-properties - Create configuration (SKILL-config.md)

Phase 2: Configuration Migration

  1. [ ] migrate-struts-xml - Plan controller structure (SKILL-xml.md)
  2. [ ] migrate-web-xml - Remove Struts filter (SKILL-xml.md)

Phase 3: Action Conversion

  1. [ ] convert-action-to-controller - Convert each Action class (SKILL-action.md)
  2. [ ] convert-action-properties - Handle Action properties (SKILL-action.md)

Phase 4: Cross-cutting Concerns

  1. [ ] convert-validation - Migrate validation logic (SKILL-interceptor.md)
  2. [ ] convert-interceptor - Convert interceptors (SKILL-interceptor.md)

Phase 5: View Layer

  1. [ ] convert-result-types - Handle result mappings (SKILL-view.md)
  2. [ ] convert-jsp-tags - Update JSP files (SKILL-view.md)
  3. [ ] convert-ognl-to-el - Fix expressions (SKILL-view.md)

Phase 6: Testing & Polish

  1. [ ] convert-test-classes - Update tests (SKILL-test.md)
  2. [ ] create-exception-handler - Global exception handling (SKILL-test.md)

Complete Transformation Example

Before (Struts)

HelloAction.java:

package com.example.action;

import com.opensymphony.xwork2.ActionSupport;

public class HelloAction extends ActionSupport {
    private String name;
    private String message;
    
    public String execute() {
        if (name == null || name.isEmpty()) {
            return INPUT;
        }
        message = "Hello, " + name + "!";
        return SUCCESS;
    }
    
    public void validate() {
        if (name != null && name.length() > 50) {
            addFieldError("name", "Name too long");
        }
    }
    
    // getters and setters
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getMessage() { return message; }
}

struts.xml:

<action name="hello" class="com.example.action.HelloAction">
    <result name="success">/WEB-INF/jsp/hello.jsp</result>
    <result name="input">/WEB-INF/jsp/hello-form.jsp</result>
</action>

hello.jsp:

<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<body>
    <s:property value="message"/>
</body>
</html>

After (Spring Boot)

HelloForm.java:

package com.example.form;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

public class HelloForm {
    @NotBlank(message = "Name is required")
    @Size(max = 50, message = "Name too long")
    private String name;
    
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
}

HelloController.java:

package com.example.controller;

import com.example.form.HelloForm;
import jakarta.validation.Valid;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;

@Controller
public class HelloController {
    
    @GetMapping("/hello")
    public String showForm(Model model) {
        model.addAttribute("helloForm", new HelloForm());
        return "hello-form";
    }
    
    @PostMapping("/hello")
    public String execute(@Valid @ModelAttribute HelloForm form,
                         BindingResult result,
                         Model model) {
        if (result.hasErrors()) {
            return "hello-form";
        }
        String message = "Hello, " + form.getName() + "!";
        model.addAttribute("message", message);
        return "hello";
    }
}

hello.jsp:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<body>
    ${message}
</body>
</html>

Application.java:

package com.example;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

application.properties:

server.port=8080
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp

04 同仓库更多 Skills

apache
apache/tika

file-to-markdown

Turn almost any file into Markdown plus metadata — PDF, Office, HTML, email, archives, images, audio/video, 1000+ formats — powered by Apache Tika, either via the tika-app CLI (zero setup, one file) or a running tika-server (curl, warm process, many calls). Leads with rmeta (structured, embedded-item-aware output) as the default operation rather than flat concatenated text, since you can't tell whether a file has embedded content from its extension. Covers metadata-only triage, type and language detection, OCR, and output-size discipline for agent context. Use whenever a task involves reading the content of a file whose format you don't want to hand-parse.

文档处理图像与多媒体
★ 4.1k
apache
apache/tika

file-to-markdown-docker

Run Apache Tika as a Docker container when you need guaranteed OCR (scanned PDFs, images) or geospatial raster support with zero local install — `apache/tika:<version>-full` bundles Tesseract, GDAL, ImageMagick, and fonts. Also covers the minimal image, port/volume/memory conventions, the path-identity mount gotcha, and how to confirm OCR actually ran rather than silently returning no text. Powered by Apache Tika. Use when a local `tika-app`/`tika-server` doesn't have Tesseract installed, or you want a disposable, self-contained parsing environment. Companion to the `file-to-markdown` skill, which covers the parsing calls themselves once a server is up.

文档处理运维与部署
★ 4.1k
apache
apache/tika

file-forensics

Examine what a file claims about itself and what it actually contains — powered by Apache Tika. True content-based type detection (extensions lie), provenance claims (authors, dates, creating application), revision and tamper signals (PDF incremental updates, tracked changes, hidden slides, zip integrity), hidden and embedded content (attachments, macros), risk indicators (PDF JavaScript actions, encryption), and content digests. Evidence gathering, not verdicts: Tika reports what the file asserts and what parsing observed; it does not attribute authorship or validate signatures. Use for triaging suspicious files, provenance questions, e-discovery-style review, or "is this file what it claims to be."

文档处理
★ 4.1k
apache
apache/tika

update-site-for-release

Update/publish the Apache Tika website (tika-site SVN repo) for a release — step 17 of the Release Process. Handles the 4.x track (Changes page + aggregate javadoc + Antora docs branch) vs the 3.x maintenance track (full per-version apt docs + javadoc). Use for "update the site", "publish the site for X.Y.Z", "the website part of the release".

★ 4.1k
apache
apache/tika

tika-eval-h2-query

Query the tika-eval H2 database directly for counts and joins the canned reports do not compute — connection gotchas, key tables, example queries. Use when the xlsx/summary.md reports are not enough.

电子表格后端与接口
★ 4.1k
apache
apache/tika

tika-eval-encoding-regression

Condensed tika-eval pattern for charset-detector regression hunts ("A picks encoding X, B picks Y") using one build and two configs — encoding-pair flip queries, OOV/languageness/FFFD signals, per-file detector attribution.

★ 4.1k