Genelet Java is a small Java 8 web framework for JSON-described CRUD-style web applications. A Genelet app keeps its runtime contract in WEB-INF/config.json and per-component component.json files, then supplies generated or hand-written Filter and Model classes for each component.
The framework is intentionally legacy-friendly: it builds with Ant, uses javax.servlet/Java EE 7-era APIs, keeps numeric framework error strings stable, and does not require Maven, Gradle, Spring, or Jakarta.
Requests are routed by path:
<Script_name>/<role>/<tag>/<component>
<Script_name>/<role>/<tag>/<component>/<id>
config.json defines the project package, servlet path, roles, chartags, authentication providers, templates, and database connection settings. Each component's component.json defines tables, keys, available actions, validation, aliases, groups, fields, foreign-key helpers, and optional next-page model calls.
For a component named pollsquestion in project package myproject, the application provides:
myproject.pollsquestion.Filter
myproject.pollsquestion.Model
Both classes expose a public Object constructor that receives the parsed component JSON. At request time the servlet creates the filter and model, fills ARGS, optionally attaches a JDBC connection, executes the requested action, and returns JSON/XML or forwards to a JSP-style template depending on the chartag.
The stable runtime contract is documented in docs/contract.md.
The framework runtime lives under src/com/genelet/framework:
GeneletServletcoordinates request parsing, auth checks, generated class loading, model execution, and response dispatch.RequestContextholds per-request path, action, ARGS, foreign-key extras, and JDBC connection state.ServletOutcomecentralizes response decisions: HTTP errors, redirects, legacy bodies, content bodies, JSON, and JSP forwards.GeneratedComponentContractparses and validates generated config/component metadata into descriptors while preserving the legacy map APIs.GeneletFilterandGeneletModelare base classes used by generated application classes.Dbiis the legacy database facade;StatementExecutorowns JDBC statement/result-set lifecycle, generated keys, stored procedures, labels, and output parameters.Crudis the legacy CRUD facade;SqlComposerowns validated SQL table, join, condition, and order construction.Base,Access,Gate,Ticket,Oauth2, andProcedureimplement auth/session behavior;AuthSessionowns cookie signing/parsing, provider lookup, issuer validation, and challenge formatting.Config,Role,Issuer,Chartag,Table, andGeneletErrorsare the runtime configuration and compatibility types.
The helper/generator code lives under src/com/genelet/helper.
src/com/genelet/framework- framework runtime.src/com/genelet/helper- JSON-driven project generator helpers.samples/tutojava- canonical generated web application sample.samples/javahelper- tiny command-line helper wrapper sample.test- framework regression and MySQL-backed tests.lib- stable repo-local third-party jars used by the Ant builds.docs/contract.md- compatibility contract for generated apps.dist- generated framework output, ignored by Git.
Build the framework jar:
ant clean jarRun the default unit tests:
ant testRun the MySQL-backed suite in Docker:
ant mysql-test
ant mysql-docker-stopmysql-test starts a mysql:5.7 container named genelet-mysql-test. Always run mysql-docker-stop afterward to remove it.
Run the full local verification used by this repo:
git diff --check
ant test
ant sample-tutojava-dist
ant mysql-test
ant mysql-docker-stop- Create a web app with a
WEB-INF/config.jsondefiningScript_name,Template,Pubrole,Chartags,Roles, and optional DB/auth settings. - For each component, create a
component.jsonwithactions,current_tableorcurrent_tables, andcurrent_keyorcurrent_keys. - Provide
<Project_name>.<component>.Filterand<Project_name>.<component>.Modelclasses with publicObjectconstructors. - Map a servlet extending
GeneletServletand load parsed config/component JSON into the servlet context. - Build against
dist/Genelet.jarand the jars inlib.
Generated apps can use no_db for actions that do not need JDBC and no_method for actions handled entirely by filter/template behavior. JSON/XML chartags return response bodies; HTML-like chartags forward to templates such as:
<Template>/<role>/<component>/<action>.<tag>
tutojava is the canonical generated web application sample. It uses myproject.* generated classes, sample component JSON files, and JSP-style HTML templates.
Build it from the repository root:
ant sample-tutojava-distThe WAR is written to:
samples/tutojava/dist/Tutojava.war
javahelper shows how to call the helper/generator code from a small command-line entry point. The helper implementation itself is maintained in src/com/genelet/helper.
Genelet keeps the legacy generated-app surface stable:
- Java 8 and Ant remain the supported build shape.
- Numeric framework error strings are preserved through
Error.getMessage(). - Cookie wire format is preserved.
javax.servletand Java EE 7-era APIs are used.- Repo-local jars in
libare the build inputs; generateddistcontent is not committed.