Arturo Bernal created JSPWIKI-1400:
--------------------------------------
Summary: Move Java code out of JSPs into Java classes (jspwiki-war
webapp)
Key: JSPWIKI-1400
URL: https://issues.apache.org/jira/browse/JSPWIKI-1400
Project: JSPWiki
Issue Type: Epic
Reporter: Arturo Bernal
Discussion: [email protected] thread "JSPs contain lots of Java code"
(Jurgen Weber, Ulf Dittmer, Arturo Bernal +1'd).
The JSPs in jspwiki-war/src/main/webapp contain substantial embedded Java
(scriptlets), not just presentation: request handling, redirects,
session/cookie state, CSRF checks, locking, etc. This should be moved into
servlets/plain Java classes under src/main/java, following the pattern the
codebase already uses elsewhere (AttachmentServlet, AtomAPIServlet,
WikiAjaxDispatcherServlet). JSPs should end up containing only HTML/JSP tags.
Scope measured against master (2026-12-01): ~29 JSPs directly under
jspwiki-war/src/main/webapp carry real logic (over 2000 lines of scriptlet code
total). Worst offenders: Edit.jsp (~270 lines), Comment.jsp (~265),
LostPassword.jsp (~176), Login.jsp (~161), rss.jsp (~128), UserPreferences.jsp
(~123), Workflow.jsp (~100). The templates/default directory is already much
cleaner (mostly small attribute-setting glue code), confirming Jurgen's
observation.
Risk: jspwiki-war has no src/test directory today -- none of these request
flows (save/preview/cancel, locking, CSRF, redirects) have automated coverage.
Each sub-task below should add test coverage for its JSP's behavior as part of
the change, not just move code.
This epic tracks one sub-task per JSP, ordered from simplest to most complex,
so the pattern gets established on low-risk pages before tackling
Edit.jsp/Comment.jsp.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)