Formio
Formio, form definition and binding library for Java platform
Install / Use
/learn @beranradek/FormioREADME
Formio 
Form definition and binding library for Java platform:
- Easy-to-use configurable handy tool.
- Automatic binding, even to immutable objects, collections and arrays, nested objects and lists of them.
- Support for (non)default constructors, static factory methods.
- Primitives can be used everywhere.
- Validation of form data (both bean validation API annotations and net.formio.validation.Validator can be used).
- Seamless support for file uploads and configurable max. request/file size.
- Form definitions are immutable, composable, self-contained, can be easily shared and cached.
- Automatic generating of form markup (or its parts) can be optionally used.
- One simple entry point to API: Forms class.
- Non-invasive, easy integration with frameworks, minimum dependencies.
- Usable with various template frameworks, in environments with or without servlets, portlets, also in desktop applications.
- Simply unit testable forms.
- Protection of forms against CSRF attacks.
- Inspired mainly by well-designed Play framework.
Available in Maven Central
https://central.sonatype.com/search?q=net.formio
Get Started and Documentation
Demo
http://formio-demo.herokuapp.com/, sources on https://github.com/beranradek/formio-demo
First Touch
1) Prepare form definition (optional automatic mapping of properties):
private static final FormMapping<Person> personForm =
Forms.automatic(Person.class, "person").build();
2) Fill it with data:
FormData<Person> formData = new FormData<Person>(person, ValidationResult.empty);
FormMapping<Person> filledForm = personForm.fill(formData);
// Push the filled form into a template, use its properties to render it;
// or use BasicFormRenderer to generate form markup automatically
3) Bind data edited by user back into an object:
FormData<Person> formData = personForm.bind(new ServletRequestParams(request));
if (formData.isValid()) {
// save the person: formData.getData()
} else {
// show again the invalid form with validation messages
// personForm.fill(formData) ...
}
Maintenance of library
Gradle Build
- Build artifacts (jar, sources, javadoc): ./gradlew clean assemble
- Run tests: gradlew test
Updating gradle wrapper: gradlew wrapper --gradle-version X.Y.Z
Release
- Remove -SNAPSHOT suffix from version in gradle.properties
- Just run: ./gradlew clean test assemble to see all is ok and ready for release.
- You can test the publishing: ./gradlew publishToMavenLocal --dry-run
- Publish by running: ./gradlew clean publishToSonatype closeAndReleaseSonatypeStagingRepository
- Login to https://central.sonatype.com/ and check Deployments. Process should be fully automatic.
- Create tag with released version (in format X.Y.Z)
- Set new version with -SNAPSHOT suffix in gradle.properties
- Push new version preparation to GitHub
See https://medium.com/viascom/publishing-to-maven-central-with-gradle-a-step-by-step-guide-f3f50724648f and https://central.sonatype.org/publish/publish-gradle/ for details.
Troubleshooting
- Deleting tag in remote repository:
git tag -d formio-x.y.z
git push master :refs/tags/formio-x.y.z
Next steps
Please check official documentation for more details about Formio usage, features, and examples.
Related Skills
node-connect
343.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
90.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
