Skip to main content

JavaServer Pages (.jsp) indexer plugin for CodeMap (https://github.com/qxbyte/codemap)

Project description

codemap-jsp

A JavaServer Pages (.jsp) indexer for CodeMap, distributed as an independent PyPI package. Targets legacy Java web projects that still ship .jsp views.

What it captures

JSP files are HTML containers with embedded Java. The indexer scans five top-level constructs:

JSP construct Captured as
<%@ page import="..." %> extra.jsp_imports on the page symbol
<%@ include file="..." %> extra.jsp_includes on the page symbol
<%! ... %> (declaration block) Java members parsed by tree-sitter-java; methods → method, fields → variable, nested classes → class
<% ... %> (scriptlet) Skipped — scriptlet locals are per-request state, not a stable interface
<form action="..." method="..."/> and <a href="..."> extra.http_client_calls on the page symbol — consumed by the host's http_route bridge to link the page to its server controller

Every JSP file produces one page-level pseudo-class symbol plus zero or more member symbols from any <%! ... %> blocks. The page name is derived from the file basename (UserList.jspUserList).

Why this matters for AI agents on legacy projects

A typical Spring MVC + JSP project has:

src/main/java/com/example/UserController.java
  @PostMapping("/api/users") void create(User u) { ... }

src/main/webapp/WEB-INF/views/users.jsp
  <form action="/api/users" method="POST"> ... </form>

The http_route bridge ships in codemap-core. Once both files are indexed, the bridge sees:

  • the server route (POST, /api/users) exposed by UserController.create
  • the client call (POST, /api/users) advertised by users.jsp

…and adds a calls edge from the page to the controller. AI agents can now answer "what JSP pages submit to this controller?" with a single codemap callers query — no grepping HTML for URLs.

Install

pip install codemap-jsp

tree-sitter-java is a hard dependency (used to parse declaration blocks). No tree-sitter-jsp grammar is needed.

SymbolID encoding

scip-jsp . . . src/main/webapp/views/UserList.jsp/UserList#tag().
└──────┘     └──────────────────────────────────────────────────┘
  scheme         path / page pseudo-class / member

Tests

pip install -e ".[dev]"
pytest

Limits / next steps

  • Scriptlet (<% ... %>) bodies are not indexed for symbol extraction — they would surface per-request locals as noise. A future v0.2.x could optionally extract control-flow shape from scriptlets to support cross-page navigation.
  • JSTL tags (<c:if>, <c:forEach>) and EL expressions (${...}) are not parsed. A codemap-jstl companion plugin could surface declared <c:set var="..."/> variables if there's demand.
  • Tag files (.tag / .tagx) are supported on the same code path as pages but their unique <%@ attribute name="..." %> directives are not yet surfaced as individual symbols.

License

MIT — same as the host project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codemap_jsp-0.4.4.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codemap_jsp-0.4.4-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file codemap_jsp-0.4.4.tar.gz.

File metadata

  • Download URL: codemap_jsp-0.4.4.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codemap_jsp-0.4.4.tar.gz
Algorithm Hash digest
SHA256 4dfb8a677539cfad749b2bbfdfad2da957c1c542e42a3aa6c18083022287e3aa
MD5 1d67d58e7d39f7a06c70c2070a0e3419
BLAKE2b-256 7e767abe9043c6341932a2fcace979b264c2259dfe26e87300f5d8e5915c667f

See more details on using hashes here.

Provenance

The following attestation bundles were made for codemap_jsp-0.4.4.tar.gz:

Publisher: publish.yml on qxbyte/codemap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codemap_jsp-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: codemap_jsp-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codemap_jsp-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b93e23d16b2bd2aea73206a5a5bc693e567b957a27cfe459c767eac18d51644c
MD5 cc54643f0efd7a2c6b6bc6bdf6a83c54
BLAKE2b-256 bbb1e74bf651e15cb0ec657fd47fa17067918e935f01acf9b376bab6704a97b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for codemap_jsp-0.4.4-py3-none-any.whl:

Publisher: publish.yml on qxbyte/codemap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page