📜 ⬆️ ⬇️

LilacServer - a box for creating websites in Java

LilacServer - everything you need in one box

In this article I would like to talk about a new software product that has recently become available to end users. I am the author of this software, and it is therefore a pleasure for me to share with readers information that someone will surely find interesting and useful. I worked on this project for 4 years (or even more, depending on what moment to count).

So what is LilacServer ?
This is a web server written in Java using Java NIO technology. The main difference from other web servers created in Java (for example, Tomcat or Resin) is that it is not only a web server ...

LilacServer is a web server, a template engine and a framework in one software product .
')

1. Web server


As mentioned above, written in Java using Java NIO, and therefore it has high performance and stress resistance. Any special hardware requirements does not impose. It can be installed both under Linux (in the complete set there are scripts under CentOS and Debian), and under Windows (in the complete set there is a wrapper for installation as a service). On shared-hosting, most likely, install will not work. A minimum of VPS is required.

The installer is designed as a jar archive that supports both graphical and textual installation modes.

Installer screenshot

A feature of setting up a web server is the complete absence of any configuration files. All management is carried out using a special web interface. In addition to the usual functionality for setting up website parameters, the web interface has a built-in file manager and an online editor.

Web Interface Screenshot

2. Template engine


LilacServer has a built-in template engine. It is even more correct to say this: a template engine is the basis of the entire software product.

To build page templates using the language Lilac . This is a declarative language similar to Prolog and Erlang. Data is presented in the form of lists. The only operation available on the lists is a “head capture”. For the uninitiated, it sounds scary, but in the end it means that neither patterns nor conditional transitions are used to design patterns (they simply do not exist in the language).

All language operations are issued in the form of directives. Total directives 7 (more precisely, 6 + 1). Directives are stored in files with the extension .lilac. The page template is assembled in parts, depending on the path to the page. There are special files with directives - this is config.lilac and index.lilac.

3. Framework


To create software modules, the Java language and its own LilacServer API are used . This API is incompatible with the standard Java Servlet API, but the set of objects and the names of the methods largely coincide.

LilacServer is a template-oriented software product. This means that the necessary software components are invoked from templates (and not vice versa: when a program is loaded that loads the required templates). In practice, this means that it is possible to create a template website without writing any Java code. That is, if a website does not require a software component, then you can not use the LilacServer API.

LilacServer API classes are included in the LilacServer software package and do not require separate installation. Software development requires Java SE JDK. If necessary, you can use any third-party libraries, the server will automatically load them.

4. Buns (and how without them!)


  1. built-in localization capabilities
    LilacServer allows you to create multilingual sites using standard tools. The localization code can be specified in the domain name, in the first part of the URI, as well as in the request parameter;
  2. database support
    LilacServer supports working with databases using the JDBC protocol. The developer only needs to install the necessary set of drivers, and in the settings of the website specify the connection parameters to the database. All further work on connection maintenance is taken over by the web server and the LilacServer API;
  3. caching
    LilacServer caches both rules and program code. Caching parameters can be managed in the website settings;
  4. Access limitation
    LilacServer with a special directive allows you to restrict access to individual pages and sections of the website. For user authentication, the Digest authentication method is used;
  5. sessions
    LilacServer has built-in tools to track user sessions. The LilacServer API has a special class for this;
  6. multipart forms and file uploads
    LilacServer has built-in tools for processing multipart-forms and uploading files to a web server (oddly enough, the Java Servlet API still cannot boast of this). The LilacServer API has a special class for this;
  7. separation of code and presentation
    LilacServer fully complies with this MVC paradigm: it implements a complete separation of application logic from its presentation.

In addition to the above, there are still many interesting features and functions.

5. Documentation and support


Official website: LilacServer.com
(direct link to the Russian version of the site: lilacserver.com/ru )
This resource was created on LilacServer itself and fully demonstrates the capabilities of both the software product and the LilacServer API.

Here is what you can find on this site:


and much more, no less useful.

I am sure that my informational message will be useful for web developers, and especially for those who actively use the Java language in their work. More information on the capabilities of the LilacServer software product can be found here .

Thank you all for your attention!

Source: https://habr.com/ru/post/150965/


All Articles