Developer documentation

Getting started with Genelet Java

This guide follows guruperl/java's README and generated-application contract. The implementation uses Java 8, Ant and javax.servlet/Java EE 7-era APIs. It is not a Jakarta namespace application.

1. Prepare a source checkout

git clone --branch master https://github.com/guruperl/java.git genelet-java
cd genelet-java
git rev-parse HEAD
java -version
ant -version

Use the repository's documented build shape and the JARs supplied under lib. Those dependencies include older versions; review their suitability, security and licensing before production deployment.

2. Build and test the framework

ant clean jar
ant test

The build produces dist/Genelet.jar. The historical tutorial assumes that file already exists; current source checkouts require the build step. The default tests and MySQL integration suite are separate targets.

3. Build the polling application sample

ant sample-tutojava-dist

The canonical sample lives in samples/tutojava. Its output is samples/tutojava/dist/Tutojava.war. It demonstrates generated application classes, component JSON and JSP-style templates.

Building a WAR is not evidence that it has been deployed successfully. Choose a compatible servlet container, configure an isolated test database where needed and verify the actual routes before exposing the application.

4. Follow the application contract

  1. Define WEB-INF/config.json with Script_name, Template, Pubrole, Chartags, Roles and optional database/authentication settings.
  2. Give each component a component.json declaring actions, table names and key names.
  3. Provide <Project_name>.<component>.Filter and Model classes with the documented public Object constructors.
  4. Map a servlet extending GeneletServlet and make parsed configuration available through the servlet context.
  5. Build against the framework JAR and the repository-local dependencies.

Read the contract for exact naming and response conventions instead of transplanting PHP or Go configuration.

5. Run optional database verification carefully

The README documents ant mysql-test and cleanup with ant mysql-docker-stop. The target uses a MySQL 5.7 test container and test credentials. Inspect the build file first: it manages a fixed-name container and published port. Use a disposable development environment with no conflicting container or database, never a production server.

The optional container smoke hook is not an embedded application-server test. Do not describe it as a successful browser or deployment test. No build, database test or WAR deployment was executed as part of this content restoration.