Introduction

Presents Civilian. Somewhat philosophical. If you are impatient, just jump to the quickstart. Or simply start reading the documentation

Web applications

We see three main parts in web applications:
  • A client which talks to a server via HTTP. The usual client is the browser, technology-wise based on HTML, CSS and JavaScript.
  • A server application which can process HTTP requests and dynamically build responses.
  • A database back-end which provides data to the server application.
Civilian is a Java framework to develop the server-side part of a web application.

Frameworks

There is no shortage of web frameworks in all languages to build the server- or client-side of web applications. Of course the reason to use a framework is because it helps to get things done.
Frameworks – in contrast to simple libraries – often prescribe a very specific way how to structure and implement an application.
But a framework can become problematic if at some point it prevents you to do something what you want to do. Difficult workarounds then often eliminate the gains achieved by using the framework in the first place.
Civilian does structure your application. But its also wants you to totally control the HTTP response and the data back-end without any restrictions. Design your application in terms of REST API, HTML and data output, Ajax communications and database back-end, then use Civilian to implement the design.

REST and clean URLs

Todays best practice recommends that a web application should process requests in a RESTful way. And the URLs exposed by an application should follow the paradigm of semantic or clean URLs.
Civilian makes it easy to implement RESTful processing and design clean URLs.

Interactions and tasks

Web applications must support a variety of clients: Talking with browsers they need to deliver HTML pages and assets likes CSS, images, script files. Content can be presented in multiple languages or locales. Data-oriented clients will send or consume data formatted as JSON, XML, etc. Recent client-side MVC JavaScript frameworks embody more than one role: They request initial pages or page templates from the server, and then use Ajax calls to obtain or send pure data. And it is still valid to develop traditional round trip applications.
Civilian supports all these web application aspects: Generation of HTML using templates. Content serialization of data in different formats. Processing of traditional HTML forms. Support for multiple languages and locales. Serving of static assets. And it integrates all in an efficient API.

Ease of development

At minimum a framework must allow to implement an application, hopefully without too many obstacles. But we really like frameworks when they are easy and fun to use.
We hope that you won't have a steep learning curve when using Civilian. The API is small, as is the footprint of the library. It contains some neat techniques to boost productivity. It does not use AbstractProxyFactoryConfigurers. You may also enjoy to take a look at the handcrafted source code. So we hope you like it.