diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..1fd5828 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +voidframework.dev \ No newline at end of file diff --git a/categories/index.xml b/categories/index.xml new file mode 100644 index 0000000..84a1c06 --- /dev/null +++ b/categories/index.xml @@ -0,0 +1 @@ +Categories on Void Frameworkhttps://voidframework.dev/categories/Recent content in Categories on Void FrameworkHugo -- gohugo.io \ No newline at end of file diff --git a/css/site.css b/css/site.css new file mode 100644 index 0000000..9bd5ea2 --- /dev/null +++ b/css/site.css @@ -0,0 +1,25 @@ +.disable-select { + user-select: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} + +.enable-select { + user-select: text; + -webkit-user-select: text; + -khtml-user-select: text; + -moz-user-select: text; + -ms-user-select: text; +} + +.nav-pills > li + li { + margin-left: 0 !important; +} + +.goat { + max-width: 650px; + margin-left: auto; + margin-right: auto; +} diff --git a/doc/advanced/advanced/index.html b/doc/advanced/advanced/index.html new file mode 100644 index 0000000..594ec35 --- /dev/null +++ b/doc/advanced/advanced/index.html @@ -0,0 +1,8 @@ +Void Framework – reference.conf

reference.conf

The reference.conf files define the various configuration keys and default values. These files are the first to be loaded when the application starts. On this page you will find links to the complete list of reference.conf files used by Void Framework.

voidframework-bucket4jreference.conf
voidframework-cachereference.conf
voidframework-corereference.conf
voidframework-datasource-c3p0reference.conf
voidframework-datasource-hikaricpreference.conf
voidframework-healthcheckreference.conf
voidframework-i18nreference.conf
voidframework-migration-flywayreference.conf
voidframework-persistence-hibernatereference.conf
voidframework-redisreference.conf
voidframework-remoteconf-etcdreference.conf
voidframework-remoteconf-httpreference.conf
voidframework-restclientreference.conf
voidframework-schedulerreference.conf
voidframework-sendmailreference.conf
voidframework-sendmail-commonsemailreference.conf
voidframework-template-freemarkerreference.conf
voidframework-validationreference.conf
voidframework-vfsreference.conf
voidframework-web-healthcheckreference.conf
voidframework-webreference.conf

+ + +
\ No newline at end of file diff --git a/doc/advanced/aspect-oriented-programming/index.html b/doc/advanced/aspect-oriented-programming/index.html new file mode 100644 index 0000000..4920e40 --- /dev/null +++ b/doc/advanced/aspect-oriented-programming/index.html @@ -0,0 +1,44 @@ +Void Framework – Aspect Oriented Programming

Aspect Oriented Programming

Aspect Oriented Programming (AOP) includes programming methods and tools that support the modularization of concerns at the level of the source code. Void Framework manages the AOP via the AspectJ and Guice libraries. The first library is more powerful but also more complicated to use, while the latter has fewer capabilities but is simple to use.


AspectJ

AspectJ runtime (aspectjrt) is already provided by the module voidframework-core, but you have to add an extra plugin to compile aspects during the compilation of your application.

<plugin>
+    <!-- https://mvnrepository.com/artifact/org.codehaus.mojo/aspectj-maven-plugin -->
+    <groupId>org.codehaus.mojo</groupId>
+    <artifactId>aspectj-maven-plugin</artifactId>
+    <version>1.16.0</version>
+    <inherited>true</inherited>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.aspectj</groupId>
+            <artifactId>aspectjtools</artifactId>
+            <version>1.9.22</version> <!-- Match version provided by Void Framework  -->
+        </dependency>
+    </dependencies>
+    
+    <configuration>
+        <complianceLevel>${java.version}</complianceLevel>
+        <source>${maven.compiler.source}</source>
+        <target>${maven.compiler.target}</target>
+        <showWeaveInfo>true</showWeaveInfo>
+        <verbose>true</verbose>
+        <Xlint>ignore</Xlint>
+        <encoding>UTF-8</encoding>
+    </configuration>
+
+    <executions>
+        <execution>
+            <goals>
+                <goal>compile</goal>
+                <goal>test-compile</goal>
+            </goals>
+        </execution>
+    </executions>
+</plugin>
+

Read more about AspectJ at:


Guice

Read more about Guice AOP at:


+ + +
\ No newline at end of file diff --git a/doc/advanced/creating-module/index.html b/doc/advanced/creating-module/index.html new file mode 100644 index 0000000..3a4f992 --- /dev/null +++ b/doc/advanced/creating-module/index.html @@ -0,0 +1,34 @@ +Void Framework – Creating Module

Creating Module

Do you want to create a Guice module that will be loaded when your application starts? Nothing could be simpler than creating an implementation of the abstract class AbstractModule or the interface Module.

To meet all needs, the Void Framework provides the ability to obtain additional information via the module’s constructor. As a constructor’s parameter, you could optionally use the following elements:

  • Config the current configuration of the application
  • ScannedClassesToLoad the classes that were scanned when the application started

if a module needs to be loaded before another, you can use the OrderedModule interface.


Example

public final class MyCustomModule extends AbstractModule implements OrderedModule {
+
+    private final Config configuration;
+    private final ScannedClassesToLoad scannedClassesToLoad;
+
+    public MyCustomModule(final Config configuration,
+                          final ScannedClassesToLoad scannedClassesToLoad) {
+
+        this.configuration = configuration;
+        this.scannedClassesToLoad = scannedClassesToLoad;
+    }
+
+    @Override
+    protected void configure() {
+    
+        // Place your module code here
+    }
+
+    @Override
+    public int priority() {
+
+        return 50;
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/advanced/index.html b/doc/advanced/index.html new file mode 100644 index 0000000..1275c6d --- /dev/null +++ b/doc/advanced/index.html @@ -0,0 +1,8 @@ +Void Framework – Advanced

Advanced


+ + +
\ No newline at end of file diff --git a/doc/cache/in-memory-cache/index.html b/doc/cache/in-memory-cache/index.html new file mode 100644 index 0000000..f6f8401 --- /dev/null +++ b/doc/cache/in-memory-cache/index.html @@ -0,0 +1,14 @@ +Void Framework – Cache engine : In-memory

Cache engine : In-memory

This implementation of the cache engine is convenient during the development phase because it avoids the installation of a distributed cache server. However, this implementation is absolutely not recommended for use in a production environment.


Installation

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-cache</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

To enable In-memory cache engine, you have to set voidframework.cache.engine to dev.voidframework.cache.engine.MemoryCacheEngine in your application configuration file.


Configuration

The following configuration key can be used in the configuration file of your application.

  • voidframework.cache.inMemory.flushWhenFullMaxItem the maximum number of items to be kept in the cache before it gets flushed.

+ + +
\ No newline at end of file diff --git a/doc/cache/index.html b/doc/cache/index.html new file mode 100644 index 0000000..a1dab3f --- /dev/null +++ b/doc/cache/index.html @@ -0,0 +1,8 @@ +Void Framework – Cache

Cache


+ + +
\ No newline at end of file diff --git a/doc/cache/redis-cache/index.html b/doc/cache/redis-cache/index.html new file mode 100644 index 0000000..564fb52 --- /dev/null +++ b/doc/cache/redis-cache/index.html @@ -0,0 +1,14 @@ +Void Framework – Cache engine : Redis

Cache engine : Redis

This implementation requires the voidframework-redis module to be properly configured.


Installation

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-cache-redis</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

To enable In-memory cache engine, you have to set voidframework.cache.engine to dev.voidframework.cache.engine.RedisCacheEngine in your application configuration file.

Redis module must be properly configured, read more about Redis configuration.


+ + +
\ No newline at end of file diff --git a/doc/cache/using-cache/index.html b/doc/cache/using-cache/index.html new file mode 100644 index 0000000..8ebedee --- /dev/null +++ b/doc/cache/using-cache/index.html @@ -0,0 +1,32 @@ +Void Framework – Using cache

Using cache

Void Framework provides the tools to use a cache system. Caching can be done in two different ways, via the use of annotations or programmatically via the use of the CacheEngine.


Using Cache with annotations

The cache can be used with the following annotations:


@CacheRemove

Indicates that the cache must be evicted.

The annotation accepts the following parameters:

  • key the cache key. It can contains dynamic information via the usage of {class}, {method} and {n} (with n the method argument position). The default value is {class}.{name}.

  • evictOn allows you to provide the exception types that must cause a cache eviction. If classes are specified, the cache will only be evicted if the specified exceptions are thrown. The default value is {}.

  • noEvictOn allows you to provide the exception types that must not cause a cache eviction. The default value is {}.


@CacheResult

Indicates that the result of the method will be cached and reused in future calls.

The annotation accepts the following parameters:

  • key the cache key. It can contains dynamic information via the usage of {class}, {method} and {n} (with n the method argument position). The default value is {class}.{name}.

  • timeToLive the maximum time to live in milliseconds. The default value is -1 (no expiration).


@CachePut

Indicates that the result of the method will be cached regardless value already exists.

  • key the cache key. It can contains dynamic information via the usage of {class}, {method} and {n} (with n the method argument position). The default value is {class}.{name}.

  • timeToLive the maximum time to live in milliseconds. The default value is -1 (no expiration).


Example
@BindClass
+public class CacheExample {
+
+    @CachePut
+    public String exampleMethod() {
+        return "value";
+    }
+}
+

Using Cache programmatically

The programmatic usage of the cache is very simple and can be done via the injection of CacheEngine.

public class CacheExample {
+
+    private final CacheEngine cacheEngine;
+
+    @Inject
+    public CacheExample(final CacheEngine cacheEngine) {
+        this.cacheEngine = cacheEngine;
+    }
+
+    public void exampleMethod() {
+        cacheEngine.set("key", "value");
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/core/boot-sequence/index.html b/doc/core/boot-sequence/index.html new file mode 100644 index 0000000..1b86eb5 --- /dev/null +++ b/doc/core/boot-sequence/index.html @@ -0,0 +1,9 @@ +Void Framework – Boot sequence

Boot sequence

Below is a diagram describing the boot sequence of Void Framework.


ScaNnOClNaOsspaSRtoehrmstoLtcGoeluLRaaioeLdCs(cagios3ediflnpaseofa)mGtCc.toueyahdirclP.uclrblececooeoovosmnnitov(fdsbdeSietyurtgrrltauapeerrapLrsrtav?ois)taaoiidrolinactbL(ly(((lo3a567ea)s)))(?ds1Yp()rEa4eSt)(mh2o.)tbeoYoEctSosntfriagpurat(i3obn)(2a)

+ + +
\ No newline at end of file diff --git a/doc/core/class-scanning/index.html b/doc/core/class-scanning/index.html new file mode 100644 index 0000000..d1ad485 --- /dev/null +++ b/doc/core/class-scanning/index.html @@ -0,0 +1,32 @@ +Void Framework – Class scanning

Class scanning

The core of the Void Framework is based on the scanning of different paths to discover elements to load. +5 types of elements are recognised during the scan:

  • Classes implementing com.google.inject.Module or extending com.google.inject.AbstractModule
  • Classes annotated with Bindable familly annotation
  • Classes implementing defined interface
  • Classes annotated with Aspect annotation
  • Interfaces annotated with Proxyable annotation

Guice module

Guice modules that extend the abstract class AbstractModule are automatically detected and loaded when the application starts. Unless the module is explicitly disabled by the voidframework.core.disabledModules configuration.


Bindable

@Bindable is a specific annotation that allows annotated classes to be considered as candidates for auto-detection during classpath scan. +Other class-level specialized annotations can also be considered as identifying a bindable and provide a clearer identification of the purpose of the class.

AnnotationDescription
@Bindable
@ControllerIndicates that an annotated class is a “Controller”
@RepositoryIndicates that an annotated class is a “Repository”
@ServiceIndicates that an annotated class is a “Service”

Defined interface

The configuration key voidframework.core.bindExtraInterfaces is used to define a set of interfaces for which to bind the found implementations. For example, converters are automatically detected in this way via the TypeConverter interface.


Aspect Oriented Programming

Aspect Oriented Programming (AOP) can be used with Void Framework, see chapter “Advanced / Aspect Oriented Programming” section for more information.


Proxyable interface

The @Proxyable annotation indicates that the implementation of the annotated interface is a proxy that will be configured by one of the modules that will be loaded when the application starts. The module can retrieve the interface(s) it is interested in via the ScannedClassesToLoad variable provided in the module constructor.


Bootstrap file generator

Scanning classes can, for several reasons, drastically increase the start-up time of the application. To mitigate this phenomenon, it is possible to use a bootstrap file, generated in advance, containing the useful classes detected during the scan. At compile time, the file resources/classpath.bootstrap will be created.

To activate the generator, simply add the following lines to the pom.xml file.

<plugin>
+    <groupId>org.codehaus.mojo</groupId>
+    <artifactId>exec-maven-plugin</artifactId>
+    <version>3.0.0</version>
+    <executions>
+        <execution>
+            <id>generate-classpath-bootstrap</id>
+            <goals>
+                <goal>java</goal>
+            </goals>
+            <phase>process-sources</phase>
+            <configuration>
+                <mainClass>dev.voidframework.core.classestoload.generator.ClasspathBootstrapGenerator</mainClass>
+                <arguments>
+                    <argument>${project.build.outputDirectory}</argument>
+                </arguments>
+            </configuration>
+        </execution>
+    </executions>
+</plugin>
+

+ + +
\ No newline at end of file diff --git a/doc/core/conditional-feature/index.html b/doc/core/conditional-feature/index.html new file mode 100644 index 0000000..b543447 --- /dev/null +++ b/doc/core/conditional-feature/index.html @@ -0,0 +1,37 @@ +Void Framework – Conditional feature

Conditional feature

Depending on your runtime environment, you may only need to run a few features of your application. And so, load only the necessary modules and bindable classes.


@ConditionalFeature

The @ConditionalFeature annotation allows a feature to be enabled or disabled depending on the processing performed by the class supplied as a parameter. This class must implement the Condition interface.

The annotation accepts the following parameter:

  • value is used to define the implementation of Condition interface to use.

Exemple

@WebController
+@ConditionalFeature(MyCustomCondition.class)
+public final class SampleController {
+}
+

@ConfigurationConditionalFeature

The @ConfigurationConditionalFeature annotation allows a feature to be enabled or disabled based on a value in the configuration, properties, or environment variables.

The annotation accepts the following parameter:

  • value is used to define the name of the configuration/property/env. variable to be read.
  • expectedValue is used to define all possible expected values. The default value is {"true", "enabled", "yes", "1"}.

Exemple

@WebController
+@ConfigurationConditionalFeature("feature.name")
+public final class SampleController {
+}
+

@RunInDevModeConditionalFeature

The @RunInDevModeConditionalFeature annotation allows a feature to be enabled only if the dev mode is set to true.

Exemple

@WebController
+@RunInDev
+public final class SampleController {
+}
+

Creating your own condition

To create your own condition, simply implement the Condition interface and use this new implementation with the @ConditionalFeature annotation. You can also create your own annotation if you wish.

Exemple

public class RunInDevModeCondition implements Condition {
+
+    @Override
+    public boolean isEnabled(final Config configuration,
+                             final Class<?> annotatedClassType,
+                             final AnnotationMetadata annotationMetadata) {
+
+        return configuration.getBoolean("voidframework.core.runInDevMode");
+    }
+}
+
@Documented
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+@ConditionalFeature(RunInDevModeCondition.class)
+public @interface RunInDevModeConditionalFeature {
+}
+

+ + +
\ No newline at end of file diff --git a/doc/core/configuration/index.html b/doc/core/configuration/index.html new file mode 100644 index 0000000..97b5d6c --- /dev/null +++ b/doc/core/configuration/index.html @@ -0,0 +1,97 @@ +Void Framework – Configuration

Configuration

Void Framework use a configuration file format is HOCON (Human-Optimized Config Object Notation). This format supports types such as integer, long, boolean, double, string, list and object. It is also possible to include other files by using include. There are two ways to write comments: using // or #. Comments can be written in-line at the end of the line or in separate lines. For more information on Typesafe Config, visit the Github project’s page.

These are the default filenames that the Config library looks for on the classpath:

  • application.conf
  • application.json
  • application.properties
  • reference.conf

JVM properties

It is sometimes useful to be able to override or simply set specific configuration values from the parameters provided at JVM startup. To do this, all properties defined via -D flag are accessible from the Configuration object.


Use another configuration file

If you need to use a custom/external configuration file, especially when your application is deployed on a server. You can use the flag -Dconfig.file to specify location of the configuration file to use.

-Dconfig.file=/path/to/your/application.conf
+

Retrieve configuration value from Java

@Service
+public class MyService {
+
+    private final Config configuration;
+
+    @Inject
+    public MyService(final Config configuration) {
+        this.configuration = configuration;
+    }
+
+    public void test() {
+        final boolean runInDevMode = configuration.getBoolean("voidframework.core.runInDevMode");
+        if (runInDevMode) {
+            // Do something
+        } else {
+            // Do something else
+        }
+    }
+}
+

Remote configuration

Once packaged, you will probably need to modulate the configuration of the application depending on the environment (ie: development, integration, production). The typical example is the configuration of the data source, you cannot define this information directly in the configuration file included in the Jars files. Void Framework allows you to load configurations that will be stored elsewhere, such as on etcd or vault.

To enable remote configuration loading, you must declare one or more providers to be used via the configuration key voidframework.core.remoteConfiguration.providers.

Provider “etcd”

<dependency>
+  <groupId>dev.voidframework</groupId>
+  <artifactId>voidframework-remoteconf-etcd</artifactId>
+  <version>1.16.0</version>
+</dependency>
+
voidframework {
+    code {
+        remoteConfiguration {
+            providers = "dev.voidframework.remoteconfiguration.provider.EtcdRemoteConfigurationProvider"
+
+            # Configuration of the remote configuration provider "etcd"
+            etcd {
+
+                # API endpoint. HTTPS endpoint could be used,
+                # but the SSL certificate must be valid
+                endpoint = "http://127.0.0.1:2379/"
+                endpoint = ${?VOID_REMOTECONF_ETCD_ENDPOINT}
+
+                # Authentication username
+                username = ""
+                username = ${?VOID_REMOTECONF_ETCD_USERNAME}
+
+                # Authentication password
+                password = ""
+                password = ${?VOID_REMOTECONF_ETCD_PASSWORD}
+
+                # Prefix. Get only values with key beginning
+                # with the configured prefix. With etcd, it
+                # must be a directory.
+                prefix = "/"
+                prefix = ${?VOID_REMOTECONF_ETCD_PREFIX}
+            }
+        }
+    }
+}
+

Provider “http”

<dependency>
+  <groupId>dev.voidframework</groupId>
+  <artifactId>voidframework-remoteconf-http</artifactId>
+  <version>1.16.0</version>
+</dependency>
+
voidframework {
+    code {
+        remoteConfiguration {
+            providers = "dev.voidframework.remoteconfiguration.provider.HttpRemoteConfigurationProvider"
+
+            # Configuration of the remote configuration provider "http"
+            http {
+
+                # Endpoint. HTTPS endpoint could be used,
+                # but the SSL certificate must be valid
+                endpoint = "http://127.0.0.1:2379/"
+                endpoint = ${?VOID_REMOTECONF_HTTP_ENDPOINT}
+
+                # Method to use (ie: GET, POST, ...)
+                method = "GET"
+                method = ${?VOID_REMOTECONF_HTTP_METHOD}
+
+                # Authentication username
+                username = null
+                username = ${?VOID_REMOTECONF_HTTP_USERNAME}
+
+                # Authentication password
+                password = null
+                password = ${?VOID_REMOTECONF_HTTP_PASSWORD}
+            }
+        }
+    }
+}
+

Creating a Remote configuration provider

Creating a new provider is very easy. Simply implement the RemoteConfigurationProvider interface or extend the AbstractRemoteConfigurationProvider abstract class.


+ + +
\ No newline at end of file diff --git a/doc/core/index.html b/doc/core/index.html new file mode 100644 index 0000000..d162fe5 --- /dev/null +++ b/doc/core/index.html @@ -0,0 +1,8 @@ +Void Framework – Core

Core


+ + +
\ No newline at end of file diff --git a/doc/core/lang/index.html b/doc/core/lang/index.html new file mode 100644 index 0000000..614f0be --- /dev/null +++ b/doc/core/lang/index.html @@ -0,0 +1,25 @@ +Void Framework – Lang

Lang

The dev.voidframework.core.lang package contains a set of Java classes that extend the basic JDK.


CUID

CUID is a collision-resistant ID optimized for horizontal scaling and performance. Read more at https://usecuid.org/. Read the Java file to get more information about available methods.

// Random CUID
+final CUID cuid = CUID.randomCUID();
+
+// CUID from String representating a CUID
+final CUID cuid = CUID.fromString("cl9gts1kw00393647w1z4v2tc");
+
+// Check if String contains a valid CUID (implicitly called by "fromString" method)
+final boolean isValid = CUID.isValid("cl9gts1kw00393647w1z4v2tc");
+

Either

Either represents a value of one or two possible types (a disjoint union). Read the Java file to get more information about available methods.

final Either<String, Integer> either = Either.ofLeft("1337");
+
+final Integer value = either.match(Integer::valueOf, right -> right);
+

TypedMap

TypedMap is a simple hashmap with typed key. Typed means that the type of the value associated to the key is part of the key itself. Read the Java file to get more information about available methods.

final TypedMap.Key<String> STRING_KEY = TypedMap.Key.of("STRING_KEY", String.class)
+final TypedMap typedMap = new TypedMap();
+
+typedMap.put(STRING_KEY, "Hello World");
+

+ + +
\ No newline at end of file diff --git a/doc/core/life-cycle/index.html b/doc/core/life-cycle/index.html new file mode 100644 index 0000000..ae92bb2 --- /dev/null +++ b/doc/core/life-cycle/index.html @@ -0,0 +1,30 @@ +Void Framework – Life cycle

Life cycle

Void Framework provides a way to manage the life of a component. The @LifeCycleStart and @LifeCycleStop annotations allow you to define the methods to be called automatically when the application is started and stopped.


@LifeCycleStart

Indicates that this method should be called when the application starts.

The annotation accepts the following parameter:

  • priority is used to define when the method will be called in relation to the others. The lower the priority, the higher the priority of the method. The default value is 1000.

@LifeCycleStop

Indicates that this method should be called when the application is stopped.

The annotation accepts the following parameters:

  • priority defines when the method will be called in relation to the others. The lower the priority, the higher the priority of the method. The default value is 1000.
  • gracefulStopTimeoutConfigKey allows you to provide a configuration key to retrieve the maximum time (duration or milliseconds) to wait before giving up and continuing to stop the application. If no key is specified, the default value 0 will be used.

Example

@BindClass
+@Singleton
+public final class ExampleLifeCycle {
+
+    @Inject
+    private final Config configuration;
+
+    @Inject
+    public ExampleLifeCycle(final Config configuration) {
+        this.configuration = configuration;
+    }
+
+    @LifeCycleStart(priority = 1000)
+    public void onStart() {
+    }
+
+    @LifeCycleStop(priority = 1)
+    public void onStop() {
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/core/type-conversion/index.html b/doc/core/type-conversion/index.html new file mode 100644 index 0000000..1ae5b96 --- /dev/null +++ b/doc/core/type-conversion/index.html @@ -0,0 +1,37 @@ +Void Framework – Type conversion

Type conversion

Type conversion is a mechanism for converting data from one type to another. For example, convert the string “1234” to an integer. The conversion is very useful when moving from one layer to another in DDD-based architectures. It is also used in the web feature to convert path param to typed values in the controller.


Using conversion

The conversion is used via the Conversion service which is accessible via direct injection.

public final class ExampleConversionService {
+
+    private final Conversion conversion;
+
+    @Inject
+    public ExampleConversionService(final Conversion conversion) {
+        this.conversion = conversion;
+    }
+
+    public void example() {
+        final String boolAsString = "true";
+        final Boolean bool = conversion.convert(boolAsString, Boolean.class);
+        // or conversion.convert(boolAsString, String.class, Boolean.class);
+    }
+}
+

Creating a new converter

The creation of a new converter is very simple, you just have to implement the TypeConverter interface and to register this implementation with the ConverterManager. The registration will be done automatically if the newly created converter is in a package which will be scanned at the start of the application (see the voidframework.core.acceptedScanPaths parameter).

/**
+ * Convert a {@code String} into an {@code Boolean}.
+ */
+public final class StringToBooleanConverter implements TypeConverter<String, Boolean> {
+
+    private static final List<String> VALUE_TRUE_LIST = Arrays.asList("1", "true", "y", "yes");
+
+    @Override
+    public Boolean convert(final String source) {
+        // The "source" variable will never be null
+        return VALUE_TRUE_LIST.contains(source.toLowerCase(Locale.ENGLISH));
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/getting-started/index.html b/doc/getting-started/index.html new file mode 100644 index 0000000..086da75 --- /dev/null +++ b/doc/getting-started/index.html @@ -0,0 +1,8 @@ +Void Framework – Getting Started

Getting Started


+ + +
\ No newline at end of file diff --git a/doc/getting-started/new-application/index.html b/doc/getting-started/new-application/index.html new file mode 100644 index 0000000..52022f5 --- /dev/null +++ b/doc/getting-started/new-application/index.html @@ -0,0 +1,49 @@ +Void Framework – Creating a new application

Creating a new application

To create a new application with Void Framework, simply create a new Maven project and then add the necessary dependencies.


Maven

The very first dependency to include in your pom.xml is voidframework-core, without it you will not be able to start the application. The dependencies to be added will depend on the features you wish to use on your application, so do not hesitate to consult the different chapters of the documentation.

In this example, we will also use the web feature, so the voidframework-web dependency will also be added.

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-core</artifactId>
+    <version>1.16.0</version>
+</dependency>
+<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-web</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

Configuration

Void Framework use a configuration file format is HOCON (Human-Optimized Config Object Notation). This format supports types such as integer, long, boolean, double, string, list and object. It is also possible to include other files by using include. There are two ways to write comments: using // or #. Comments can be written in-line at the end of the line or in separate lines. For more information on Typesafe Config, visit the Github project’s page.

The first thing to do is to indicate the paths to scan to find the elements of your application that can be loaded. The default location for the configuration file is resources/application.conf. And to define a key to sign the Session (even if you plan to not use session).

voidframework {
+    core {
+        acceptedScanPaths += "controller"
+    }
+
+    web {
+        session {
+            signatureKey = "BUXpcQ6OAXMGR45sV9bjeq161raMoIrNiJw3z18leM4TRIBVUHsZsrTlK58fX2JD"
+        }
+    }
+}
+

Web controller

Add the following controller to the controller package or any package that will be considered by the acceptedScanPaths configuration.

package controller;
+
+import dev.voidframework.web.bindable.WebController;
+import dev.voidframework.web.http.HttpContentType;
+import dev.voidframework.web.http.Result;
+import dev.voidframework.web.http.param.RequestRoute;
+import dev.voidframework.web.routing.HttpMethod;
+
+@WebController
+public final class MyFirstController {
+
+    @RequestRoute(method = HttpMethod.GET, route = "/")
+    public Result sayHello() {
+        return Result.ok("Hello World!");
+    }
+}
+

Application launcher

To start the application, you have to instantiate ApplicationLauncher and then call the launch method.

final VoidApplication app = new VoidApplication();
+app.launch();
+

Run your application

You can now start your application and go to the URL http://127.0.0.1:9000 in your favourite web browser.


+ + +
\ No newline at end of file diff --git a/doc/getting-started/requirements/index.html b/doc/getting-started/requirements/index.html new file mode 100644 index 0000000..86b386e --- /dev/null +++ b/doc/getting-started/requirements/index.html @@ -0,0 +1,19 @@ +Void Framework – Requirements

Requirements

To use the Void Framework, you need Java JDK 17 or higher, Maven 3 or higher and the Void Framework JAR files. These JAR files are published to the Maven Repository.


Verifying and installing Java

To check that you have Java JDK 17 or higher, enter the following in a shell:

#> java -version
+

You should see something like:

openjdk version "17.0.2" 2022-01-18
+OpenJDK Runtime Environment (build 17.0.2+8-86)
+OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)
+

If Java JDK is not available on your computer, you can get Java JDK from Oracle’s website.


Verifying and installing Java

To check that you have Maven 3 or higher, enter the following in a shell:

#> mvn -version
+

You should see something like:

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
+Maven home: C:\maven\lib\maven3
+Java version: 17.0.2, vendor: Oracle Corporation, runtime: C:\Users\user\.jdks\openjdk-17.0.2
+Default locale: en_US, platform encoding: UTF-8
+OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
+

If Maven is not available on your computer, you can get Maven from Apache Maven Project.


+ + +
\ No newline at end of file diff --git a/doc/getting-started/upgrading-from-old-version/index.html b/doc/getting-started/upgrading-from-old-version/index.html new file mode 100644 index 0000000..7bf23e7 --- /dev/null +++ b/doc/getting-started/upgrading-from-old-version/index.html @@ -0,0 +1,9 @@ +Void Framework – Upgrading from old version

Upgrading from old version

Sometimes important changes will be introduced that will break the backwards compatibility with older versions of the framework. On this page you will find the necessary steps to make your application work with the latest version.


1.0.0

Initial release


1.1.0

  • ApplicationLauncher has been renamed to VoidApplication
  • The setting key voidframework.web.session.signatureKey is now required

1.2.0

  • The CSRF filter has been moved to the dev.voidframework.web.http.filter.csrf package, if you use this filter in your application, you will need to modify the configuration key voidframework.web.globalFilters
  • The Security Headers filter has been moved to the dev.voidframework.web.http.filter.security package, if you use this filter in your application, you will need to modify the configuration key voidframework.web.globalFilters
  • Annotations NoCSRF, RequestBody, RequestPath, RequestRoute, RequestVariable and WithFilter has been moved to the package dev.voidframework.web.http.annotation

1.3.0

  • Annotations @CacheRemove and @CacheResult are now in the package dev.voidframework.cache.annotation
  • Redis parameter connectionTimeout is now a duration, a time unit must be provided
  • addInList method of the voidframework-redis module now adds items to the end of the list
  • Classes from dev.voidframework.core.helper has been moved to dev.voidframework.core.utils and the suffix Utils has been added (ie: IO is now named IOUtils)
  • Method Result::redirectPermanentlyTo has been renamed to Result::redirectMovedPermanently
  • Method Result::redirectTemporaryTo has been renamed to Result::redirectFound
  • Class HttpMimeType has been renamed to HttpMimeTypes
  • Method HttpRequestBodyContent::asRaw now return an InputStream
  • Class ValidationError is now a record. All methods are now named without any prefix (ie: getMessage() is now named message())

1.4.0

  • Method Router::addRoute has changed. The routeUrl parameter is now of type RouteURL. You can use RouteURL::of to migrate to the new format

1.5.0

  • Annotation @BindClass has been renamed to @Bindable

1.6.0

  • Configuration keys voidframework.web.server.listenHost and voidframework.web.server.listenPort have been renamed to voidframework.web.server.http.listenHost and voidframework.web.server.http.listenPort

1.8.0


1.12.0

  • Constants PARENTHESIS_OPEN and PARENTHESIS_CLOSE are no longer inverted. If you use these two constants, take care to adapt their use

+ + +
\ No newline at end of file diff --git a/doc/i18n/index.html b/doc/i18n/index.html new file mode 100644 index 0000000..f199d17 --- /dev/null +++ b/doc/i18n/index.html @@ -0,0 +1,8 @@ +Void Framework – Internationalization

Internationalization


+ + +
\ No newline at end of file diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..319fda8 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,8 @@ +Void Framework – Documentation

Documentation


+ + +
\ No newline at end of file diff --git a/doc/index.xml b/doc/index.xml new file mode 100644 index 0000000..f4632d0 --- /dev/null +++ b/doc/index.xml @@ -0,0 +1,135 @@ +Docs on Void Frameworkhttps://voidframework.dev/doc/Recent content in Docs on Void FrameworkHugo -- gohugo.ioGetting Startedhttps://voidframework.dev/doc/getting-started/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/Getting Startedhttps://voidframework.dev/doc/getting-started/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/Corehttps://voidframework.dev/doc/core/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/Corehttps://voidframework.dev/doc/core/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/Relational Databaseshttps://voidframework.dev/doc/relational-databases/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/Relational Databaseshttps://voidframework.dev/doc/relational-databases/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/NoSQL Databaseshttps://voidframework.dev/doc/nosql-databases/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/nosql-databases/NoSQL Databaseshttps://voidframework.dev/doc/nosql-databases/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/nosql-databases/Cachehttps://voidframework.dev/doc/cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/Cachehttps://voidframework.dev/doc/cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/Internationalizationhttps://voidframework.dev/doc/i18n/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/i18n/Internationalizationhttps://voidframework.dev/doc/i18n/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/i18n/REST Clienthttps://voidframework.dev/doc/rest-client/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/rest-client/REST Clienthttps://voidframework.dev/doc/rest-client/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/rest-client/Schedulerhttps://voidframework.dev/doc/scheduler/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/scheduler/Schedulerhttps://voidframework.dev/doc/scheduler/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/scheduler/Sendmailhttps://voidframework.dev/doc/sendmail/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/Sendmailhttps://voidframework.dev/doc/sendmail/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/Templatehttps://voidframework.dev/doc/template/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/template/Virtual File Storagehttps://voidframework.dev/doc/vfs/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/vfs/Virtual File Storagehttps://voidframework.dev/doc/vfs/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/vfs/Webhttps://voidframework.dev/doc/web/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/Webhttps://voidframework.dev/doc/web/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/Testinghttps://voidframework.dev/doc/testing/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/testing/Testinghttps://voidframework.dev/doc/testing/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/testing/Advancedhttps://voidframework.dev/doc/advanced/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/Advancedhttps://voidframework.dev/doc/advanced/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/Aspect Oriented Programminghttps://voidframework.dev/doc/advanced/aspect-oriented-programming/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/aspect-oriented-programming/Aspect Oriented Programming (AOP) includes programming methods and tools that support the modularization of concerns at the level of the source code. Void Framework manages the AOP via the AspectJ and Guice libraries. The first library is more powerful but also more complicated to use, while the latter has fewer capabilities but is simple to use. +AspectJ AspectJ runtime (aspectjrt) is already provided by the module voidframework-core, but you have to add an extra plugin to compile aspects during the compilation of your application.Aspect Oriented Programminghttps://voidframework.dev/doc/advanced/aspect-oriented-programming/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/aspect-oriented-programming/Aspect Oriented Programming (AOP) includes programming methods and tools that support the modularization of concerns at the level of the source code. Void Framework manages the AOP via the AspectJ and Guice libraries. The first library is more powerful but also more complicated to use, while the latter has fewer capabilities but is simple to use. +AspectJ AspectJ runtime (aspectjrt) is already provided by the module voidframework-core, but you have to add an extra plugin to compile aspects during the compilation of your application.Boot sequencehttps://voidframework.dev/doc/core/boot-sequence/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/boot-sequence/Below is a diagram describing the boot sequence of Void Framework. +S c a N n O C l N a O s s p a S R t o e h r m s t o L t c G o e l u L R a a i o e L d C s ( c a g i o s 3 e d i f l n p a s e o f a ) m G t C c .Boot sequencehttps://voidframework.dev/doc/core/boot-sequence/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/boot-sequence/Below is a diagram describing the boot sequence of Void Framework. +S c a N n O C l N a O s s p a S R t o e h r m s t o L t c G o e l u L R a a i o e L d C s ( c a g i o s 3 e d i f l n p a s e o f a ) m G t C c .Cache engine : In-memoryhttps://voidframework.dev/doc/cache/in-memory-cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/in-memory-cache/This implementation of the cache engine is convenient during the development phase because it avoids the installation of a distributed cache server. However, this implementation is absolutely not recommended for use in a production environment. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-cache&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; To enable In-memory cache engine, you have to set voidframework.cache.engine to dev.voidframework.cache.engine.MemoryCacheEngine in your application configuration file. +Configuration The following configuration key can be used in the configuration file of your application.Cache engine : In-memoryhttps://voidframework.dev/doc/cache/in-memory-cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/in-memory-cache/This implementation of the cache engine is convenient during the development phase because it avoids the installation of a distributed cache server. However, this implementation is absolutely not recommended for use in a production environment. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-cache&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; To enable In-memory cache engine, you have to set voidframework.cache.engine to dev.voidframework.cache.engine.MemoryCacheEngine in your application configuration file. +Configuration The following configuration key can be used in the configuration file of your application.Cache engine : Redishttps://voidframework.dev/doc/cache/redis-cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/redis-cache/This implementation requires the voidframework-redis module to be properly configured. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-cache-redis&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; To enable In-memory cache engine, you have to set voidframework.cache.engine to dev.voidframework.cache.engine.RedisCacheEngine in your application configuration file. +Redis module must be properly configured, read more about Redis configuration.Cache engine : Redishttps://voidframework.dev/doc/cache/redis-cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/redis-cache/This implementation requires the voidframework-redis module to be properly configured. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-cache-redis&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; To enable In-memory cache engine, you have to set voidframework.cache.engine to dev.voidframework.cache.engine.RedisCacheEngine in your application configuration file. +Redis module must be properly configured, read more about Redis configuration.Class scanninghttps://voidframework.dev/doc/core/class-scanning/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/class-scanning/The core of the Void Framework is based on the scanning of different paths to discover elements to load. 5 types of elements are recognised during the scan: +Classes implementing com.google.inject.Module or extending com.google.inject.AbstractModule Classes annotated with Bindable familly annotation Classes implementing defined interface Classes annotated with Aspect annotation Interfaces annotated with Proxyable annotation Guice module Guice modules that extend the abstract class AbstractModule are automatically detected and loaded when the application starts.Class scanninghttps://voidframework.dev/doc/core/class-scanning/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/class-scanning/The core of the Void Framework is based on the scanning of different paths to discover elements to load. 5 types of elements are recognised during the scan: +Classes implementing com.google.inject.Module or extending com.google.inject.AbstractModule Classes annotated with Bindable familly annotation Classes implementing defined interface Classes annotated with Aspect annotation Interfaces annotated with Proxyable annotation Guice module Guice modules that extend the abstract class AbstractModule are automatically detected and loaded when the application starts.Conditional featurehttps://voidframework.dev/doc/core/conditional-feature/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/conditional-feature/Depending on your runtime environment, you may only need to run a few features of your application. And so, load only the necessary modules and bindable classes. +@ConditionalFeature The @ConditionalFeature annotation allows a feature to be enabled or disabled depending on the processing performed by the class supplied as a parameter. This class must implement the Condition interface. +The annotation accepts the following parameter: +value is used to define the implementation of Condition interface to use.Conditional featurehttps://voidframework.dev/doc/core/conditional-feature/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/conditional-feature/Depending on your runtime environment, you may only need to run a few features of your application. And so, load only the necessary modules and bindable classes. +@ConditionalFeature The @ConditionalFeature annotation allows a feature to be enabled or disabled depending on the processing performed by the class supplied as a parameter. This class must implement the Condition interface. +The annotation accepts the following parameter: +value is used to define the implementation of Condition interface to use.Configurationhttps://voidframework.dev/doc/core/configuration/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/configuration/Void Framework use a configuration file format is HOCON (Human-Optimized Config Object Notation). This format supports types such as integer, long, boolean, double, string, list and object. It is also possible to include other files by using include. There are two ways to write comments: using // or #. Comments can be written in-line at the end of the line or in separate lines. For more information on Typesafe Config, visit the Github project&rsquo;s page.Configurationhttps://voidframework.dev/doc/core/configuration/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/configuration/Void Framework use a configuration file format is HOCON (Human-Optimized Config Object Notation). This format supports types such as integer, long, boolean, double, string, list and object. It is also possible to include other files by using include. There are two ways to write comments: using // or #. Comments can be written in-line at the end of the line or in separate lines. For more information on Typesafe Config, visit the Github project&rsquo;s page.Controllerhttps://voidframework.dev/doc/web/controller/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/controller/Controllers receive incoming web requests, process them and return a result. They are the entry point to your web application. Controllers can return almost any type of data, as long as it is handled by the Result object. It is a convention imposed by Void Framework that methods which handle incoming requests must return a Result. +Example +@Singleton @WebController(prefixRoute = &#34;/account&#34;) public class AccountController { @RequestRoute(route = &#34;/(?&lt;accountId&gt;[a-f0-9]+)&#34;) public Result showAccount(@RequestPath(&#34;accountId&#34;) final String accountId) { return Result.Controllerhttps://voidframework.dev/doc/web/controller/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/controller/Controllers receive incoming web requests, process them and return a result. They are the entry point to your web application. Controllers can return almost any type of data, as long as it is handled by the Result object. It is a convention imposed by Void Framework that methods which handle incoming requests must return a Result. +Example +@Singleton @WebController(prefixRoute = &#34;/account&#34;) public class AccountController { @RequestRoute(route = &#34;/(?&lt;accountId&gt;[a-f0-9]+)&#34;) public Result showAccount(@RequestPath(&#34;accountId&#34;) final String accountId) { return Result.Creating a new applicationhttps://voidframework.dev/doc/getting-started/new-application/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/new-application/To create a new application with Void Framework, simply create a new Maven project and then add the necessary dependencies. +Maven The very first dependency to include in your pom.xml is voidframework-core, without it you will not be able to start the application. The dependencies to be added will depend on the features you wish to use on your application, so do not hesitate to consult the different chapters of the documentation.Creating a new applicationhttps://voidframework.dev/doc/getting-started/new-application/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/new-application/To create a new application with Void Framework, simply create a new Maven project and then add the necessary dependencies. +Maven The very first dependency to include in your pom.xml is voidframework-core, without it you will not be able to start the application. The dependencies to be added will depend on the features you wish to use on your application, so do not hesitate to consult the different chapters of the documentation.Creating Modulehttps://voidframework.dev/doc/advanced/creating-module/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/creating-module/Do you want to create a Guice module that will be loaded when your application starts? Nothing could be simpler than creating an implementation of the abstract class AbstractModule or the interface Module. +To meet all needs, the Void Framework provides the ability to obtain additional information via the module&rsquo;s constructor. As a constructor&rsquo;s parameter, you could optionally use the following elements: +Config the current configuration of the application ScannedClassesToLoad the classes that were scanned when the application started if a module needs to be loaded before another, you can use the OrderedModule interface.Creating Modulehttps://voidframework.dev/doc/advanced/creating-module/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/creating-module/Do you want to create a Guice module that will be loaded when your application starts? Nothing could be simpler than creating an implementation of the abstract class AbstractModule or the interface Module. +To meet all needs, the Void Framework provides the ability to obtain additional information via the module&rsquo;s constructor. As a constructor&rsquo;s parameter, you could optionally use the following elements: +Config the current configuration of the application ScannedClassesToLoad the classes that were scanned when the application started if a module needs to be loaded before another, you can use the OrderedModule interface.CSRFhttps://voidframework.dev/doc/web/security-csrf/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/security-csrf/Cross-site request forgery (CSRF), also known as one-click attack or session riding, is a type of malicious vector attack of a website where unauthorized commands are submitted from a user that the web application trusts. +&nbsp; It is recommended that you familiarize yourself with CSRF. We recommend starting with this information from OWASP. Void Framework provides a CSRF filter that can be applied globally to all requests or only on specific endpoints.Data sourcehttps://voidframework.dev/doc/relational-databases/datasource/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/datasource/Your application needs to connect to one or more databases? Void Framework is capable of handling multiple data sources at the same time through the use of DataSourceManager. It will provide all the necessary methods to obtain a connection from the desired data source. Each data source can be configured independently. Your application can, for example, be connected to PostgreSQL and Oracle at the same time. +Installation Void Framework offers different implementations, depending on the implementation chosen, the configuration keys may change.Data sourcehttps://voidframework.dev/doc/relational-databases/datasource/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/datasource/Your application needs to connect to one or more databases? Void Framework is capable of handling multiple data sources at the same time through the use of DataSourceManager. It will provide all the necessary methods to obtain a connection from the desired data source. Each data source can be configured independently. Your application can, for example, be connected to PostgreSQL and Oracle at the same time. +Installation Void Framework offers different implementations, depending on the implementation chosen, the configuration keys may change.Filtershttps://voidframework.dev/doc/web/filters/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/filters/Filters are the middleware and are individual functions that make up the request processing pipeline. +&nbsp; Note that the use of dependencies direct injection is possible in filters. Specific filters The use of filters is done through the use of the @WithFiter annotation. It is possible to specify as many filters as you wish, the order in which they are declared representing the order in which they are used. +@FilterWith({FirstFilter.java, SecondFilter.Filtershttps://voidframework.dev/doc/web/filters/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/filters/Filters are the middleware and are individual functions that make up the request processing pipeline. +&nbsp; Note that the use of dependencies direct injection is possible in filters. Specific filters The use of filters is done through the use of the @WithFiter annotation. It is possible to specify as many filters as you wish, the order in which they are declared representing the order in which they are used. +@FilterWith({FirstFilter.java, SecondFilter.FreeMarkerhttps://voidframework.dev/doc/template/freemarker/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/template/freemarker/To generate HTML document with FreeMarker, you have to use the module voidframework-template-freemarker. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-template-freemarker&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Templates location By default, templates should be placed in the resources/views directory. +Configuration The following configuration keys can be used in the configuration file of your application: +voidframework.template.basePackagePath the location of the templates. The default value is &quot;/views/&quot;. Built-in methods &amp; variables By default, modules web and template-freemarker provide a set of methods and variables that will be accessible in templates.FreeMarkerhttps://voidframework.dev/doc/template/freemarker/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/template/freemarker/To generate HTML document with FreeMarker, you have to use the module voidframework-template-freemarker. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-template-freemarker&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Templates location By default, templates should be placed in the resources/views directory. +Configuration The following configuration keys can be used in the configuration file of your application: +voidframework.template.basePackagePath the location of the templates. The default value is &quot;/views/&quot;. Built-in methods &amp; variables By default, modules web and template-freemarker provide a set of methods and variables that will be accessible in templates.H2https://voidframework.dev/doc/relational-databases/h2/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/h2/H2 is an open-source lightweight relational database. It allows you to quickly have an operational database and its use is very practical during the development phase of an application. This module provides the H2 dependency and the useful H2 web console. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-h2&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration The following configuration keys can be used in the configuration file of your application:H2https://voidframework.dev/doc/relational-databases/h2/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/h2/H2 is an open-source lightweight relational database. It allows you to quickly have an operational database and its use is very practical during the development phase of an application. This module provides the H2 dependency and the useful H2 web console. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-h2&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration The following configuration keys can be used in the configuration file of your application:Hibernatehttps://voidframework.dev/doc/relational-databases/persistence-hibernate/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/persistence-hibernate/Hibernate is an Object Relational Mapper (ORM). It provides a framework for mapping an object-oriented domain model to a relational database. +&nbsp; Void Framework uses Hibernate 6 (or higher), which that means Java persistence is no longer defined by the Java Persistence API under Java EE, but rather by to the Jakarta Persistence 3.0 specification under Jakarta EE. This means the javax.persistence package is no longer available and is replaced by jakarta.Hibernatehttps://voidframework.dev/doc/relational-databases/persistence-hibernate/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/persistence-hibernate/Hibernate is an Object Relational Mapper (ORM). It provides a framework for mapping an object-oriented domain model to a relational database. +&nbsp; Void Framework uses Hibernate 6 (or higher), which that means Java persistence is no longer defined by the Java Persistence API under Java EE, but rather by to the Jakarta Persistence 3.0 specification under Jakarta EE. This means the javax.persistence package is no longer available and is replaced by jakarta.jOOQ ORMhttps://voidframework.dev/doc/relational-databases/persistence-jooq/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/persistence-jooq/jOOQ is an Object Relational Mapper (ORM). It provides a framework for mapping an object-oriented domain model to a relational database. +Installation This module adds support for the Transactional annotation as well as setting up an DSLContext provider pre-configured with all the data sources configured via the datasource module. There is no special configuration to apply, just add the voidframework-persistence-jooq module to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-persistence-jooq&lt;/artifactId&gt; &lt;version&gt;1.jOOQ ORMhttps://voidframework.dev/doc/relational-databases/persistence-jooq/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/persistence-jooq/jOOQ is an Object Relational Mapper (ORM). It provides a framework for mapping an object-oriented domain model to a relational database. +Installation This module adds support for the Transactional annotation as well as setting up an DSLContext provider pre-configured with all the data sources configured via the datasource module. There is no special configuration to apply, just add the voidframework-persistence-jooq module to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-persistence-jooq&lt;/artifactId&gt; &lt;version&gt;1.JUnit's extensionhttps://voidframework.dev/doc/testing/junit-extension/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/testing/junit-extension/It is very important to test the code of an application. Void Framework provides tools for JUnit 5 to run your unit tests in a ready-to-use context as well as with support for Mockito annotations. +To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-test&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; JUnit&rsquo;s extension The JUnit 5 extension will initialise the Void Framework application and initialise the variables annotated with Mockito annotations.JUnit's extensionhttps://voidframework.dev/doc/testing/junit-extension/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/testing/junit-extension/It is very important to test the code of an application. Void Framework provides tools for JUnit 5 to run your unit tests in a ready-to-use context as well as with support for Mockito annotations. +To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-test&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; JUnit&rsquo;s extension The JUnit 5 extension will initialise the Void Framework application and initialise the variables annotated with Mockito annotations.Langhttps://voidframework.dev/doc/core/lang/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/lang/The dev.voidframework.core.lang package contains a set of Java classes that extend the basic JDK. +CUID CUID is a collision-resistant ID optimized for horizontal scaling and performance. Read more at https://usecuid.org/. Read the Java file to get more information about available methods. +// Random CUID final CUID cuid = CUID.randomCUID(); // CUID from String representating a CUID final CUID cuid = CUID.fromString(&#34;cl9gts1kw00393647w1z4v2tc&#34;); // Check if String contains a valid CUID (implicitly called by &#34;fromString&#34; method) final boolean isValid = CUID.Langhttps://voidframework.dev/doc/core/lang/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/lang/The dev.voidframework.core.lang package contains a set of Java classes that extend the basic JDK. +CUID CUID is a collision-resistant ID optimized for horizontal scaling and performance. Read more at https://usecuid.org/. Read the Java file to get more information about available methods. +// Random CUID final CUID cuid = CUID.randomCUID(); // CUID from String representating a CUID final CUID cuid = CUID.fromString(&#34;cl9gts1kw00393647w1z4v2tc&#34;); // Check if String contains a valid CUID (implicitly called by &#34;fromString&#34; method) final boolean isValid = CUID.Life cyclehttps://voidframework.dev/doc/core/life-cycle/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/life-cycle/Void Framework provides a way to manage the life of a component. The @LifeCycleStart and @LifeCycleStop annotations allow you to define the methods to be called automatically when the application is started and stopped. +&nbsp; It is possible to have several methods of a class annotated with the same annotation. @LifeCycleStart Indicates that this method should be called when the application starts. +The annotation accepts the following parameter: +priority is used to define when the method will be called in relation to the others.Life cyclehttps://voidframework.dev/doc/core/life-cycle/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/life-cycle/Void Framework provides a way to manage the life of a component. The @LifeCycleStart and @LifeCycleStop annotations allow you to define the methods to be called automatically when the application is started and stopped. +&nbsp; It is possible to have several methods of a class annotated with the same annotation. @LifeCycleStart Indicates that this method should be called when the application starts. +The annotation accepts the following parameter: +priority is used to define when the method will be called in relation to the others.Mailer : Apache Commons Emailhttps://voidframework.dev/doc/sendmail/mailer-apache-commons-email/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/mailer-apache-commons-email/This implementation of the mailer uses the Apache Commons Email library. It allows you to easily send email via SMTP. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-sendmail-commonsemail&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; To enable this mailer, you have to set voidframework.sendmail.engine to dev.voidframework.sendmail.engine.ApacheCommonsEmailMailerEngine in your application configuration file. +Configuration The following configuration keys can be used in the configuration file of your application: +voidframework.sendmail.commonsemail.username user name for authentication. The default value is null. voidframework.sendmail.commonsemail.password password for authentication.Mailer : Apache Commons Emailhttps://voidframework.dev/doc/sendmail/mailer-apache-commons-email/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/mailer-apache-commons-email/This implementation of the mailer uses the Apache Commons Email library. It allows you to easily send email via SMTP. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-sendmail-commonsemail&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; To enable this mailer, you have to set voidframework.sendmail.engine to dev.voidframework.sendmail.engine.ApacheCommonsEmailMailerEngine in your application configuration file. +Configuration The following configuration keys can be used in the configuration file of your application: +voidframework.sendmail.commonsemail.username user name for authentication. The default value is null. voidframework.sendmail.commonsemail.password password for authentication.Mailer : Dummyhttps://voidframework.dev/doc/sendmail/mailer-dummy/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/mailer-dummy/This implementation is particularly useful locally during development. It simply displays the email in the console rather than sending a real email. +Installation To enable this mailer, you have to set voidframework.sendmail.engine to dev.voidframework.sendmail.engine.DummyMailerEngine in your application configuration file.Mailer : Dummyhttps://voidframework.dev/doc/sendmail/mailer-dummy/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/mailer-dummy/This implementation is particularly useful locally during development. It simply displays the email in the console rather than sending a real email. +Installation To enable this mailer, you have to set voidframework.sendmail.engine to dev.voidframework.sendmail.engine.DummyMailerEngine in your application configuration file.Redishttps://voidframework.dev/doc/nosql-databases/redis/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/nosql-databases/redis/Sometimes a relational database does not fit the need, so you have to turn to more specific, non-relational databases. Void Framework provides the tools to use the NoSQL database Redis. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-redis&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration The following configuration key can be used in the configuration file of your application. +voidframework.redis.host the Redis server host.Redishttps://voidframework.dev/doc/nosql-databases/redis/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/nosql-databases/redis/Sometimes a relational database does not fit the need, so you have to turn to more specific, non-relational databases. Void Framework provides the tools to use the NoSQL database Redis. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-redis&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration The following configuration key can be used in the configuration file of your application. +voidframework.redis.host the Redis server host.reference.confhttps://voidframework.dev/doc/advanced/advanced/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/advanced/The reference.conf files define the various configuration keys and default values. These files are the first to be loaded when the application starts. On this page you will find links to the complete list of reference.conf files used by Void Framework. +voidframework-bucket4j reference.conf voidframework-cache reference.conf voidframework-core reference.conf voidframework-datasource-c3p0 reference.conf voidframework-datasource-hikaricp reference.conf voidframework-healthcheck reference.conf voidframework-i18n reference.conf voidframework-migration-flyway reference.conf voidframework-persistence-hibernate reference.conf voidframework-redis reference.conf voidframework-remoteconf-etcd reference.conf voidframework-remoteconf-http reference.conf voidframework-restclient reference.conf voidframework-scheduler reference.conf voidframework-sendmail reference.reference.confhttps://voidframework.dev/doc/advanced/advanced/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/advanced/The reference.conf files define the various configuration keys and default values. These files are the first to be loaded when the application starts. On this page you will find links to the complete list of reference.conf files used by Void Framework. +voidframework-bucket4j reference.conf voidframework-cache reference.conf voidframework-core reference.conf voidframework-datasource-c3p0 reference.conf voidframework-datasource-hikaricp reference.conf voidframework-healthcheck reference.conf voidframework-i18n reference.conf voidframework-migration-flyway reference.conf voidframework-persistence-hibernate reference.conf voidframework-redis reference.conf voidframework-remoteconf-etcd reference.conf voidframework-remoteconf-http reference.conf voidframework-restclient reference.conf voidframework-scheduler reference.conf voidframework-sendmail reference.Render templatehttps://voidframework.dev/doc/web/render-template/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/render-template/The web module also integrates the template module with the Freemarker rendering engine by default. This allows controllers to return html content easily. +Although you can manually use the template engine, in most cases this would not be handy. However, you can use the TemplateResult class which will make it easier to use the renderer. +Built-in methods &amp; variables By default, the module voidframework-template-freemarker provide a set of methods and variables that will be accessible in templates.Requirementshttps://voidframework.dev/doc/getting-started/requirements/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/requirements/To use the Void Framework, you need Java JDK 17 or higher, Maven 3 or higher and the Void Framework JAR files. These JAR files are published to the Maven Repository. +Verifying and installing Java To check that you have Java JDK 17 or higher, enter the following in a shell: +#&gt; java -version You should see something like: +openjdk version &#34;17.0.2&#34; 2022-01-18 OpenJDK Runtime Environment (build 17.0.2+8-86) OpenJDK 64-Bit Server VM (build 17.Requirementshttps://voidframework.dev/doc/getting-started/requirements/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/requirements/To use the Void Framework, you need Java JDK 17 or higher, Maven 3 or higher and the Void Framework JAR files. These JAR files are published to the Maven Repository. +Verifying and installing Java To check that you have Java JDK 17 or higher, enter the following in a shell: +#&gt; java -version You should see something like: +openjdk version &#34;17.0.2&#34; 2022-01-18 OpenJDK Runtime Environment (build 17.0.2+8-86) OpenJDK 64-Bit Server VM (build 17.Retrofit 2https://voidframework.dev/doc/rest-client/retrofit2/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/rest-client/retrofit2/Retrofit 2 is a REST Client for Java allowing to retrieve and upload data via HTTP. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-restclient&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; How it work All interfaces annotated with @RestClient will be automatically proxyfied with the Retrofit 2 client. +Configuration The following configuration key can be used in the configuration file of your application +voidframework.restclient.maxIdleConnections the number of connection to keep idle.Retrofit 2https://voidframework.dev/doc/rest-client/retrofit2/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/rest-client/retrofit2/Retrofit 2 is a REST Client for Java allowing to retrieve and upload data via HTTP. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-restclient&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; How it work All interfaces annotated with @RestClient will be automatically proxyfied with the Retrofit 2 client. +Configuration The following configuration key can be used in the configuration file of your application +voidframework.restclient.maxIdleConnections the number of connection to keep idle.Scheduling a local jobhttps://voidframework.dev/doc/scheduler/scheduling-job-cron/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/scheduler/scheduling-job-cron/If your application have to schedule a job in a scheduled way (ie: every 5 seconds), not dependending when the application has started, you can schedule job by using delay. In other hand, if you want a precise scheduling not depending on when the application has started, you can use a CRON expression. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.Scheduling a local jobhttps://voidframework.dev/doc/scheduler/scheduling-job-cron/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/scheduler/scheduling-job-cron/If your application have to schedule a job in a scheduled way (ie: every 5 seconds), not dependending when the application has started, you can schedule job by using delay. In other hand, if you want a precise scheduling not depending on when the application has started, you can use a CRON expression. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.Security headershttps://voidframework.dev/doc/web/security-headers/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/security-headers/Void Framework provides a basic filter to add certain headers to HTTP responses by default. These headers allow you to add an extra level of security to your application. +Configuration The following configuration keys can be used in the configuration file of your application. +voidframework.web.securityHeaders.contentTypeOptions the value for the header &ldquo;X-Content-Type-Options&rdquo;. The default value is nosniff. voidframework.web.securityHeaders.frameOptions the value for the header &ldquo;X-Frame-Options&rdquo;. The default value is DENY. voidframework.web.securityHeaders.xssProtection the value for the header &ldquo;X-XSS-Protection&rdquo;.Sending emailshttps://voidframework.dev/doc/sendmail/sending-emails/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/sending-emails/If your application needs to send a few emails, you can easily do so via the voidframework-sendmail module. Sending emails is a not blocking operation, the emails are added to a queue that will be consumed asynchronously. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-sendmail&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; In addition to this basic module, you will need a mailer implementation. By default, the base module provides an implementation intended for local testing. For normal use, you can for example use the voidframework-sendmail-commonsemail moduleSending emailshttps://voidframework.dev/doc/sendmail/sending-emails/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/sending-emails/If your application needs to send a few emails, you can easily do so via the voidframework-sendmail module. Sending emails is a not blocking operation, the emails are added to a queue that will be consumed asynchronously. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-sendmail&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; In addition to this basic module, you will need a mailer implementation. By default, the base module provides an implementation intended for local testing. For normal use, you can for example use the voidframework-sendmail-commonsemail moduleSessionhttps://voidframework.dev/doc/web/session/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/session/If you need to store data between HTTP requests, you can store it in the session. The data stored in the session is available throughout the user&rsquo;s session. +&nbsp; Note that the session is not stored on the server side, but on the client side via the use of a digitally signed Cookie. Because session is implemented using cookies, there are some implications. The data size is limited to 4 KiB Only string can be stored Configuration The following configuration keys can be used in the configuration file of your application.Sessionhttps://voidframework.dev/doc/web/session/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/session/If you need to store data between HTTP requests, you can store it in the session. The data stored in the session is available throughout the user&rsquo;s session. +&nbsp; Note that the session is not stored on the server side, but on the client side via the use of a digitally signed Cookie. Because session is implemented using cookies, there are some implications. The data size is limited to 4 KiB Only string can be stored Configuration The following configuration keys can be used in the configuration file of your application.Transactionalhttps://voidframework.dev/doc/relational-databases/transactional/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/transactional/It is possible to work within a transaction in two ways: manually or via the use of the @Transactional annotation. The first one is highly dependent of the used backend (ie: Hibernate vs jOOQ), the second one is fully handled by Void Framework. For more information on the manual management of transactions, go to the page corresponding to the backend used. +@Transactional The transactional annotation itself defines the scope of a single database transaction.Transactionalhttps://voidframework.dev/doc/relational-databases/transactional/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/transactional/It is possible to work within a transaction in two ways: manually or via the use of the @Transactional annotation. The first one is highly dependent of the used backend (ie: Hibernate vs jOOQ), the second one is fully handled by Void Framework. For more information on the manual management of transactions, go to the page corresponding to the backend used. +@Transactional The transactional annotation itself defines the scope of a single database transaction.Type conversionhttps://voidframework.dev/doc/core/type-conversion/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/type-conversion/Type conversion is a mechanism for converting data from one type to another. For example, convert the string &ldquo;1234&rdquo; to an integer. The conversion is very useful when moving from one layer to another in DDD-based architectures. It is also used in the web feature to convert path param to typed values in the controller. +Using conversion The conversion is used via the Conversion service which is accessible via direct injection.Type conversionhttps://voidframework.dev/doc/core/type-conversion/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/type-conversion/Type conversion is a mechanism for converting data from one type to another. For example, convert the string &ldquo;1234&rdquo; to an integer. The conversion is very useful when moving from one layer to another in DDD-based architectures. It is also used in the web feature to convert path param to typed values in the controller. +Using conversion The conversion is used via the Conversion service which is accessible via direct injection.Upgrading from old versionhttps://voidframework.dev/doc/getting-started/upgrading-from-old-version/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/upgrading-from-old-version/Sometimes important changes will be introduced that will break the backwards compatibility with older versions of the framework. On this page you will find the necessary steps to make your application work with the latest version. +1.0.0 Initial release +1.1.0 ApplicationLauncher has been renamed to VoidApplication The setting key voidframework.web.session.signatureKey is now required 1.2.0 The CSRF filter has been moved to the dev.voidframework.web.http.filter.csrf package, if you use this filter in your application, you will need to modify the configuration key voidframework.Using cachehttps://voidframework.dev/doc/cache/using-cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/using-cache/Void Framework provides the tools to use a cache system. Caching can be done in two different ways, via the use of annotations or programmatically via the use of the CacheEngine. +&nbsp; If no CacheEngine implementation was specified, the cache will not be active. &nbsp; Note that caching a Result (Web) object can lead to errors during deserialization, especially if Result contains an InputStream. Serialization and deserialization of cached objects is handled by the Kryo library.Using cachehttps://voidframework.dev/doc/cache/using-cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/using-cache/Void Framework provides the tools to use a cache system. Caching can be done in two different ways, via the use of annotations or programmatically via the use of the CacheEngine. +&nbsp; If no CacheEngine implementation was specified, the cache will not be active. &nbsp; Note that caching a Result (Web) object can lead to errors during deserialization, especially if Result contains an InputStream. Serialization and deserialization of cached objects is handled by the Kryo library.Using internationalizationhttps://voidframework.dev/doc/internationalization/using-i18n/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/internationalization/using-i18n/Depending on your needs, you may need to use translated messages in different languages. By default the Void Framework provides a ResourceBundle based implementation. If your needs require more advanced management or different storage (ie: DB rather than files), you can easily use your own implementation. +To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-i18n&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Defining messages Translations should be placed in a file named messages_&lt;LANG&gt;.Using internationalizationhttps://voidframework.dev/doc/internationalization/using-i18n/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/internationalization/using-i18n/Depending on your needs, you may need to use translated messages in different languages. By default the Void Framework provides a ResourceBundle based implementation. If your needs require more advanced management or different storage (ie: DB rather than files), you can easily use your own implementation. +To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-i18n&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Defining messages Translations should be placed in a file named messages_&lt;LANG&gt;.Using templatehttps://voidframework.dev/doc/template/using-template/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/template/using-template/Sooner or later you will need to generate documents (HTML, PDF&hellip;). Void Framework provides all the tools you need! +Example public class TemplateExample { private final TemplateRenderer templateRenderer; @Inject public TemplateExample(final TemplateRenderer templateRenderer) { this.templateRenderer = templateRenderer; } public void renderTemplate() { final Map&lt;String, Object&gt; dataModel = new HashMap&lt;&gt;(); dataModel.put(&#34;greating.msg&#34;, &#34;Hello World!&#34;) final String result = templateRenderer.render( &#34;renderWithDataModel.ftl&#34;, Locale.ENGLISH, dataModel); System.out.println(result); } } &nbsp; Note that the data Map must be mutable.Using Virtual File Storagehttps://voidframework.dev/doc/vfs/using-vfs/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/vfs/using-vfs/When you need to store or retrieve files, you don&rsquo;t necessarily want to deal with the complexity or you just want to hide it behind an easy to use interface. Void Framework exposes the VirtualFileStorage interface which allows you to use any storage engine very simply within your application. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-vfs&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration Different VirtualFileStorage implementations must be configured in voidframework.Using Virtual File Storagehttps://voidframework.dev/doc/vfs/using-vfs/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/vfs/using-vfs/When you need to store or retrieve files, you don&rsquo;t necessarily want to deal with the complexity or you just want to hide it behind an easy to use interface. Void Framework exposes the VirtualFileStorage interface which allows you to use any storage engine very simply within your application. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-vfs&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration Different VirtualFileStorage implementations must be configured in voidframework.Using Webhttps://voidframework.dev/doc/web/using-web/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/using-web/Does your application need to have web entry points (ie: http(s) or websocket) to provide an API or web pages? The voidframework-web module will best meet your expectations. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-web&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration The following configuration keys can be used. +Base +voidframework.web.gracefulStopTimeout the time (duration or milliseconds) for the web daemon to shut down properly.Using Webhttps://voidframework.dev/doc/web/using-web/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/using-web/Does your application need to have web entry points (ie: http(s) or websocket) to provide an API or web pages? The voidframework-web module will best meet your expectations. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-web&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration The following configuration keys can be used. +Base +voidframework.web.gracefulStopTimeout the time (duration or milliseconds) for the web daemon to shut down properly. \ No newline at end of file diff --git a/doc/internationalization/using-i18n/index.html b/doc/internationalization/using-i18n/index.html new file mode 100644 index 0000000..64adfe8 --- /dev/null +++ b/doc/internationalization/using-i18n/index.html @@ -0,0 +1,58 @@ +Void Framework – Using internationalization

Using internationalization

Depending on your needs, you may need to use translated messages in different languages. By default the Void Framework provides a ResourceBundle based implementation. If your needs require more advanced management or different storage (ie: DB rather than files), you can easily use your own implementation.

To enable this module, just add following lines to the pom.xml file of your project.

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-i18n</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

Defining messages

Translations should be placed in a file named messages_<LANG>.properties (ie: messages_en.properties) in the resources directory.

resources/messages_fr.properties

lang.fr=Français
+

resources/messages_en.properties

lang.fr=French
+

Retrieving messages

The retrieval of translated messages is done through the use of the Internationalization service.

Example

public final class InternationalizationExample {
+
+    private final Internationalization i18n;
+
+    @Inject
+    public InternationalizationExample(final Internationalization i18n) {
+        this.i18n = i18n;
+    }
+
+    public void i18n() {
+        // Output: Français
+        i18n.getMessage(Locale.FRENCH, "lang.fr");
+
+        // Output: French
+        i18n.getMessage(Locale.ENGLISH, "lang.fr");
+    }
+}        
+

Plural forms

The plural form can be handled in two ways, the first uses ChoiceFormat which allows via an advanced syntax to add some intelligence to the translation messages. The second, more simple, is based on the use of new keys with special naming.

Example (ChoiceFormat)

key=This element contains {0,choice,0#no comments|1#one comment|1<{0,number,000} comments}
+
public void i18n() {
+    // Output: This element contains 0 comments
+    i18n.getMessage(Locale.ENGLISH, "key", 0);
+
+    // Output: This element contains 1 comment
+    i18n.getMessage(Locale.ENGLISH, "key", 1);
+
+    // Output: This element contains 1337 comments
+    i18n.getMessage(Locale.ENGLISH, "key", 1337);
+}
+

Example (New key)

inbox.0=Inbox "{0}" contains no messages
+inbox.1=Inbox "{0}" contains one message
+inbox.2=Inbox "{0}" contains {1} messages
+
public void i18n() {
+    // Output: Inbox "Unread" contains no messages
+    i18n.getMessage(Locale.ENGLISH, 0, "inbox", "Unread", 0);
+
+    // Output: Inbox "Unread" contains one message
+    i18n.getMessage(Locale.ENGLISH, 1,"inbox", "Unread", 1);
+
+    // Output: Inbox "Unread" contains 42 messages
+    i18n.getMessage(Locale.ENGLISH, 42, "inbox", "Unread", 42);
+}
+

+ + +
\ No newline at end of file diff --git a/doc/nosql-databases/index.html b/doc/nosql-databases/index.html new file mode 100644 index 0000000..e47af5b --- /dev/null +++ b/doc/nosql-databases/index.html @@ -0,0 +1,8 @@ +Void Framework – NoSQL Databases

NoSQL Databases


+ + +
\ No newline at end of file diff --git a/doc/nosql-databases/redis/index.html b/doc/nosql-databases/redis/index.html new file mode 100644 index 0000000..f1a2d9d --- /dev/null +++ b/doc/nosql-databases/redis/index.html @@ -0,0 +1,33 @@ +Void Framework – Redis

Redis

Sometimes a relational database does not fit the need, so you have to turn to more specific, non-relational databases. Void Framework provides the tools to use the NoSQL database Redis.


Installation

To enable this module, just add following lines to the pom.xml file of your project.

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-redis</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

Configuration

The following configuration key can be used in the configuration file of your application.

  • voidframework.redis.host the Redis server host. Default value is 127.0.0.1.
  • voidframework.redis.port the port on which the server is listening. Default value is 6379.
  • voidframework.redis.username the authentication username (Redis 6 ACL). By default, this value is empty.
  • voidframework.redis.password the authentication password. By default, this value is empty.
  • voidframework.redis.defaultDatabase the database to use by default. Default value is 1.
  • voidframework.redis.connPool.connectionTimeout the connection timeout in milliseconds. Default value is 2000 milliseconds.
  • voidframework.redis.connPool.maximumWait the maximum time to obtain a connection from the pool. Default value is 2000 milliseconds.
  • voidframework.redis.connPool.minimumIdle the minimum number of idle connections. Default value is 2.
  • voidframework.redis.connPool.maximumIdle the maximum number of idle connections. Default value is 8.
  • voidframework.redis.connPool.maximumPoolSize the maximum number of connections. Default value is 16.

Healthcheck

If you wan to monitoring Redis health, you can enable the healthcheck module by adding the following lines to the pom.xml file of your project.

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-redis-healthcheck</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

Example

@Service
+public final class ExampleService {
+
+    private final Redis redis;
+
+    @Inject
+    public ExampleService(final Redis redis) {
+        this.redis = redis;
+    }
+
+    public void example() {
+        final long nextValue = this.redis.increment("incr.key");
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/relational-databases/datasource/index.html b/doc/relational-databases/datasource/index.html new file mode 100644 index 0000000..4c74f5d --- /dev/null +++ b/doc/relational-databases/datasource/index.html @@ -0,0 +1,63 @@ +Void Framework – Data source

Data source

Your application needs to connect to one or more databases? Void Framework is capable of handling multiple data sources at the same time through the use of DataSourceManager. It will provide all the necessary methods to obtain a connection from the desired data source. Each data source can be configured independently. Your application can, for example, be connected to PostgreSQL and Oracle at the same time.


Installation

Void Framework offers different implementations, depending on the implementation chosen, the configuration keys may change. Here you will find all the information to fully configure each implementation.

C3P0
<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-datasource-c3p0</artifactId>
+    <version>1.16.0</version>
+</dependency>
+
HikariCP
<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-datasource-hikaricp</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

Configuration

The following configuration keys can be used in the configuration file of your application:

  • required +voidframework.datasource.default.driver the driver to be used to communicate with the database.
  • required +voidframework.datasource.default.url the JDBC format URL to be used to reach the database.
  • required +voidframework.datasource.default.username the username to be provided durint the authentication step.
  • required +voidframework.datasource.default.password the password to be provided durint the authentication step.
  • optional +C3P0 only +voidframework.datasource.default.statementCacheNumDeferredCloseThreads the number of threads to track when Connections are in use, and only destroy Statements when their parent Connections are not otherwise in use.
  • optional +HikariCP only +voidframework.datasource.default.cachePrepStmts enable or disable the prepared statements cache.
  • optional +voidframework.datasource.default.prepStmtCacheSize the number of prepared statements cache to keep in the cache.
  • optional +HikariCP only +voidframework.datasource.default.prepStmtCacheSqlLimit the size of the largest SQL query for which the parsing result will be keep in the cache.
  • optional +voidframework.datasource.default.autoCommit enable or disable the auto commit behavior when the connection goes back into the pool.
  • optional +HikariCP only +voidframework.datasource.default.connectionInitSql the SQL statement that will be executed after every new connection.
  • optional +HikariCP only +voidframework.datasource.default.connectionTestQuery the SQL statement that will be executed to test if the connection is still valid.
  • optional +voidframework.datasource.default.connectionTimeout the milliseconds to wait before timing out during the connection.
  • optional +voidframework.datasource.default.idleTimeout the milliseconds to wait before closing an unused connection.
  • optional +HikariCP only +voidframework.datasource.default.keepaliveTime the milliseconds to wait before attempting to keep the connection alive.
  • optional +voidframework.datasource.default.minimumIdle the minimum number of alive connections in the pool.
  • optional +voidframework.datasource.default.maximumPoolSize the maximum number of connections allowed in the pool.
  • optional +C3P0 only +voidframework.datasource.default.acquireIncrement determines how many connections at a time C3P0 will try to acquire when the pool is exhausted.
  • optional +voidframework.datasource.default.maxConnectionAge the milliseconds to wait before closing a connection.

Usage

@Service
+public class ExampleDataSourceService {
+
+    private final Provider<DataSourceManager> dataSourceManagerProvider;
+
+    @Inject
+    public ExampleService(final Provider<DataSourceManager> dataSourceManagerProvider) {
+        this.dataSourceManagerProvider = dataSourceManagerProvider;
+    }
+
+    public void example() throws SQLException {
+      final Connection conn = dataSourceManagerProvider
+          .get()
+          .getConnection("default");
+      /* ... */
+      conn.close();
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/relational-databases/h2/index.html b/doc/relational-databases/h2/index.html new file mode 100644 index 0000000..97cb88d --- /dev/null +++ b/doc/relational-databases/h2/index.html @@ -0,0 +1,14 @@ +Void Framework – H2

H2

H2 is an open-source lightweight relational database. It allows you to quickly have an operational database and its use is very practical during the development phase of an application. This module provides the H2 dependency and the useful H2 web console.


Installation

To enable this module, just add following lines to the pom.xml file of your project.

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-h2</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

Configuration

The following configuration keys can be used in the configuration file of your application:

  • voidframework.h2.webPort the listen port of the H2 console. The default value is 9002.
  • voidframework.h2.webAdminPassword the password to access preferences and tools of H2 console. The default value is null (disabled).
  • voidframework.h2.webAllowOthers specifies if other computers are allowed to connect. The default value is false.

Open the web console

Once your application has started, you can access the H2 web console by going to http://127.0.0.1:9002.


+ + +
\ No newline at end of file diff --git a/doc/relational-databases/index.html b/doc/relational-databases/index.html new file mode 100644 index 0000000..544047e --- /dev/null +++ b/doc/relational-databases/index.html @@ -0,0 +1,8 @@ +Void Framework – Relational Databases

Relational Databases


+ + +
\ No newline at end of file diff --git a/doc/relational-databases/persistence-hibernate/index.html b/doc/relational-databases/persistence-hibernate/index.html new file mode 100644 index 0000000..dcdbbeb --- /dev/null +++ b/doc/relational-databases/persistence-hibernate/index.html @@ -0,0 +1,92 @@ +Void Framework – Hibernate

Hibernate

Hibernate is an Object Relational Mapper (ORM). It provides a framework for mapping an object-oriented domain model to a relational database.


Installation

This module adds support for the Transactional annotation as well as setting up an EntityManager provider pre-configured with all the data sources configured via the datasource module. There is no special configuration to apply, just add the voidframework-persistence-hibernate module to the pom.xml file of your project.

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-persistence-hibernate</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

Configuration

The following configuration key can be used in the configuration file of your application.

  • voidframework.persistence.modelsJarUrlPattern Pattern to select Jar to scan to find models. For more information, see below the section “Speed-up PersistenceEntityFactory initialization time”. Default value is auto.
  • voidframework.datasource.default.dialect the Redis server host. Default value is null.

Working with transaction manually

final EntityManager entityManager = this.entityManagerProvider.get();
+final EntityTransaction transaction = entityManager.getTransaction();
+
+transaction.begin();
+/* insert/update/delete operations */
+transaction.commit();
+

Identifier generator

Identifier typeAssignable toIdentifier generator annotation
CUIDCUID, String, byte[]@CuidGenerator
UUIDUUID, String, byte[]@UuidGenerator

Exemple

@Entity
+@DynamicUpdate
+@Table(name = "NEWS")
+public class NewsModel extends Model {
+
+    @Id
+    @UuidGenerator
+    @Column(name = "ID", updatable = false, nullable = false)
+    private UUID id;
+
+    @Column(name = "TITLE", nullable = false)
+    private String title;
+
+    @Column(name = "CONTENT", nullable = false)
+    private String content;
+
+    @Column(name = "PUBLISHED_AT", columnDefinition = "TIMESTAMP", updatable = false, nullable = false)
+    private LocalDateTime publishedAt;
+
+    @Override
+    public String toString() {
+        return this.getClass().getName() + "[id=" + this.id + "]";
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(final String title) {
+        this.title = title;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(final String content) {
+        this.content = content;
+    }
+
+    public LocalDateTime getPublishedAt() {
+        return publishedAt;
+    }
+
+    public void setPublishedAt(final LocalDateTime publishedAt) {
+        this.publishedAt = publishedAt;
+    }
+}
+
public class NewsRepositoryImpl implements NewsRepository {
+
+    private final Conversion conversion;
+    private final Provider<EntityManager> entityManagerProvider;
+
+    @Inject
+    public NewsRepositoryImpl(final Conversion conversion,
+                              final Provider<EntityManager> entityManagerProvider) {
+        this.conversion = conversion;
+        this.entityManagerProvider = entityManagerProvider;
+    }
+
+    @Overide
+    @Transactional(Transactional.TxType.SUPPORTS)
+    public List<News> findTop10ByPublishedAtBeforeNowOrderByPublishedAtDesc() {
+        final List<NewsModel> newsModelList = entityManagerProvider.get()
+                .createQuery("SELECT x FROM NewsModel x WHERE x.publishedAt <= CURRENT_TIMESTAMP ORDER BY x.publishedAt DESC, x.id ASC", NewsModel.class)
+                .setMaxResults(10)
+                .getResultList();
+
+        return conversion.convert(newsModelList, NewsModel.class, News.class);
+    }
+

Speed-up PersistenceEntityFactory initialization time

By default, Void Framework tells the PersistenceEntityFactory to scan all JARs of the application’s and dependencies. This scan is necessary to detect models. If you want to greatly improve this initialization time, it is advisable to set the voidframework.persistence.modelsJarUrlPattern configuration key to indicate which JARs to keep. The could be null, a regular expression, or auto (default value).

If the configuration is set to null, only the current JAR / classpath (when started in IDE) will be used. auto is like using the regular expression (.*).


+ + +
\ No newline at end of file diff --git a/doc/relational-databases/persistence-jooq/index.html b/doc/relational-databases/persistence-jooq/index.html new file mode 100644 index 0000000..c5eb40a --- /dev/null +++ b/doc/relational-databases/persistence-jooq/index.html @@ -0,0 +1,128 @@ +Void Framework – jOOQ ORM

jOOQ ORM

jOOQ is an Object Relational Mapper (ORM). It provides a framework for mapping an object-oriented domain model to a relational database.


Installation

This module adds support for the Transactional annotation as well as setting up an DSLContext provider pre-configured with all the data sources configured via the datasource module. There is no special configuration to apply, just add the voidframework-persistence-jooq module to the pom.xml file of your project.

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-persistence-jooq</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

Generator

To work, jOOQ needs files generated during the compilation of the project. It is possible to generate the required classes in different ways (scan database, scan entity, …). For more information, please visit the official jOOQ website.

To enable code generation, add & customize the code below.

pom.xml

<build>
+    <plugins>
+        <plugin>
+            <groupId>org.jooq</groupId>
+            <artifactId>jooq-codegen-maven</artifactId>
+            <executions>
+                <execution>
+                    <id>jooq-codegen</id>
+                    <phase>generate-sources</phase>
+                    <goals>
+                        <goal>generate</goal>
+                    </goals>
+                </execution>
+            </executions>
+            <configuration>
+                <configurationFile>${project.build.sourceDirectory}/../resources/jooq-code-generator.xml</configurationFile>
+            </configuration>
+        </plugin>
+        <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>build-helper-maven-plugin</artifactId>
+            <executions>
+                <execution>
+                    <id>add-jooq-gen-code-test-sources</id>
+                    <phase>generate-sources</phase>
+                    <goals>
+                        <goal>add-test-source</goal>
+                    </goals>
+                    <configuration>
+                        <sources>
+                            <source>${project.build.directory}/generated-sources/java/</source>
+                        </sources>
+                    </configuration>
+                </execution>
+            </executions>
+        </plugin>
+    </plugins>
+</build>
+

jooq-code-generator.xml

<configuration>
+    <generator>
+        <database>
+            <name>org.jooq.meta.extensions.jpa.JPADatabase</name>
+            <properties>
+
+                <!-- A comma separated list of Java packages, that contain your entities -->
+                <property>
+                    <key>packages</key>
+                    <value>com.myapp.models</value>
+                </property>
+
+                <!-- Whether JPA 2.1 AttributeConverters should be auto-mapped to jOOQ Converters.
+                     Custom <forcedType/> configurations will have a higher priority than these auto-mapped converters.
+                     This defaults to true. -->
+                <property>
+                    <key>useAttributeConverters</key>
+                    <value>true</value>
+                </property>
+
+                <!-- The default schema for unqualified objects:
+
+                     - public: all unqualified objects are located in the PUBLIC (upper case) schema
+                     - none: all unqualified objects are located in the default schema (default)
+
+                     This configuration can be overridden with the schema mapping feature -->
+                <property>
+                    <key>unqualifiedSchema</key>
+                    <value>public</value>
+                </property>
+            </properties>
+        </database>
+        <target>
+            <packageName>com.myapp.models.jooq</packageName>
+            <directory>target/generated-test-sources/java</directory>
+        </target>
+    </generator>
+</configuration>
+

Working with transaction manually

final DSLContext dslContext = this.dslContextProvider.get();
+dslContext.transaction((configuration) -> {
+    /* insert/update/delete operations with configuration.dsl() */
+});
+

Exemple

@Entity
+@Table(name = "NEWS")
+public class NewsModel {
+
+    @Id
+    @Column(name = "ID", nullable = false)
+    public String id;
+
+    @Column(name = "TITLE", nullable = false)
+    public String title;
+}
+
public class NewsRepositoryImpl implements NewsRepository {
+
+    private final Conversion conversion;
+    private final Provider<DSLContext> dslContext;
+
+    @Inject
+    public NewsRepositoryImpl(final Conversion conversion,
+                              final Provider<DSLContext> dslContextProvider) {
+        this.conversion = conversion;
+        this.dslContext = dslContext;
+    }
+
+    @Overide
+    @Transactional(Transactional.TxType.SUPPORTS)
+    public List<News> findAll() {
+        final List<NewsModel> newsModelList = dslContextProvider.get()
+            .select()
+            .from(Tables.NEWS)
+            .where(Tables.NEWS.TITLE.isNotNull())
+            .fetchInto(NewsModel.class);
+
+        return conversion.convert(newsModelList, NewsModel.class, News.class);
+    }
+

+ + +
\ No newline at end of file diff --git a/doc/relational-databases/transactional/index.html b/doc/relational-databases/transactional/index.html new file mode 100644 index 0000000..0b69c2f --- /dev/null +++ b/doc/relational-databases/transactional/index.html @@ -0,0 +1,9 @@ +Void Framework – Transactional

Transactional

It is possible to work within a transaction in two ways: manually or via the use of the @Transactional annotation. The first one is highly dependent of the used backend (ie: Hibernate vs jOOQ), the second one is fully handled by Void Framework. For more information on the manual management of transactions, go to the page corresponding to the backend used.


@Transactional

The transactional annotation itself defines the scope of a single database transaction. Void Framework fully implements Transactional (Jakarta) annotation, so all availables options can be used without any restrictions.

If annotation is used both at class and method level, the second one will take ascendance.


+ + +
\ No newline at end of file diff --git a/doc/rest-client/index.html b/doc/rest-client/index.html new file mode 100644 index 0000000..9f7661c --- /dev/null +++ b/doc/rest-client/index.html @@ -0,0 +1,8 @@ +Void Framework – REST Client

REST Client


+ + +
\ No newline at end of file diff --git a/doc/rest-client/retrofit2/index.html b/doc/rest-client/retrofit2/index.html new file mode 100644 index 0000000..6e9707d --- /dev/null +++ b/doc/rest-client/retrofit2/index.html @@ -0,0 +1,56 @@ +Void Framework – Retrofit 2

Retrofit 2

Retrofit 2 is a REST Client for Java allowing to retrieve and upload data via HTTP.


Installation

To enable this module, just add following lines to the pom.xml file of your project.

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-restclient</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

How it work

All interfaces annotated with @RestClient will be automatically proxyfied with the Retrofit 2 client.


Configuration

The following configuration key can be used in the configuration file of your application

  • voidframework.restclient.maxIdleConnections the number of connection to keep idle. The default value is 5.
  • voidframework.restclient.keepAliveDuration the duration for which connections will be kept idle before being closed. The default value is 5 minutes.
  • voidframework.restclient.connectionTimeout the connect timeout duration. The default value is 15 seconds.
  • voidframework.restclient.readTimeout the read timeout duration. The default value is 35 seconds.
  • voidframework.restclient.authentication.type the authentication type to use (API_KEY, BASIC or BEARER). The default value is null (disabled).
  • voidframework.restclient.authentication.apiKeyName the API key variable name. This setting is only used if the authentication type is set to API_KEY. The default value is null.
  • voidframework.restclient.authentication.apiKeyValue the API key variable value. This setting is only used if the authentication type is set to API_KEY. The default value is null.
  • voidframework.restclient.authentication.apiKeyAddTo where to add the API key (COOKIE, HEADER, QUERY_PARAMETER). This setting is only used if the authentication type is set to API_KEY. The default value is HEADER.
  • voidframework.restclient.authentication.basicUsername the basic authentication username. This setting is only used if the authentication type is set to BASIC. The default value is null.
  • voidframework.restclient.authentication.basicPassword the basic authentication password. This setting is only used if the authentication type is set to BASIC. The default value is null.
  • voidframework.restclient.authentication.basicUseISO88591Encoding use ISO-8859-1 encoding rather than UTF-8. This setting is only used if the authentication type is set to BASIC. The default value is false.
  • voidframework.restclient.authentication.bearerPrefix the bearer prefix to use in the request header. This setting is only used if the authentication type is set to BEARER. The default value is Bearer.
  • voidframework.restclient.authentication.bearerToken the bearer token to use in the request header. This setting is only used if the authentication type is set to BEARER. The default value is null.

Examples

voidframework {
+    restclient {
+
+        maxIdleConnections = 10
+
+        echo-api {
+
+            endpoint = "https://postman-echo.com"
+            maxIdleConnections = 1
+            readTimeout = "15 seconds"
+        }
+    }
+}
+
@RestClient("echo-api")
+private interface EchoApiRestClient {
+
+    @GET("/get")
+    String echo(@Query("msg") final String message);
+
+    @POST("/post")
+    @Headers("Content-Type: application/json")
+    JsonNode postJsonNode(@Body final JsonNode message);
+}
+
@Service
+private class SampleService {
+
+    private final EchoApiRestClient echoApiRestClient;
+
+    @Inject
+    public SampleService(final EchoApiRestClient echoApiRestClient) {
+        
+        this.echoApiRestClient = echoApiRestClient;
+    }
+
+    public String mySample() {
+        
+        return this.echoApiRestClient.echo("Hello World");
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/scheduler/index.html b/doc/scheduler/index.html new file mode 100644 index 0000000..67c976f --- /dev/null +++ b/doc/scheduler/index.html @@ -0,0 +1,8 @@ +Void Framework – Scheduler

Scheduler


+ + +
\ No newline at end of file diff --git a/doc/scheduler/scheduling-job-cron/index.html b/doc/scheduler/scheduling-job-cron/index.html new file mode 100644 index 0000000..659c465 --- /dev/null +++ b/doc/scheduler/scheduling-job-cron/index.html @@ -0,0 +1,38 @@ +Void Framework – Scheduling a local job

Scheduling a local job

If your application have to schedule a job in a scheduled way (ie: every 5 seconds), not dependending when the application has started, you can schedule job by using delay. In other hand, if you want a precise scheduling not depending on when the application has started, you can use a CRON expression.


Installation

To enable this module, just add following lines to the pom.xml file of your project.

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-scheduler</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

Define a Job

To define a job, simply use the @Scheduled annotation on one or more methods of a bindable class. As a reminder, a class is said to be bindable when it is annotated with, at least, the @Bindable annotation.

The @Scheduled annotation accepts the following parameters:

  • fixedDelay the time in milliseconds between the end of the last execution and the next execution. The default value is 0 (disabled).
  • fixedRate the time in milliseconds between each execution. The default value is 0 (disabled).
  • initialDelay the time in milliseconds to wait before the first execution of “fixedDelay” or “fixedRate”. The default value is 0 (disabled).
  • cron a CRON-like expression. The default value is empty (disabled).
  • cronZone the time zone for which the CRON expression will be resolved. The default value is UTC.

CRON expression

The format of the CRON expression have to be composed of : second, minute, hour, day of month, month and day of week.

UnitValueStep ValueDetails
Second0 – 591 – 60
Minute0 – 591 – 60
Hour0 – 231 – 24
Day of Month1 – 311 – 32
Month1 – 121 – 131: January, 2: February, …, 12: December
Day of Week0 – 61 – 70: Sunday, 1: Monday, …, 6: Saturday

To improve readability, you can also replace Month and Day of Week with an abbreviation of the desired value.

  • Month: JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
  • Day of Week: SUN, MON, TUE, WEB, THU, FRI, SAT

Examples

@BindClass
+public final class Ping {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(Ping.class);
+
+    @Scheduled(fixedDelay = 5000, initialDelay = 10000)
+    public void doPingEveryFiveSecondsAfter10Seconds() {
+        LOGGER.info("PING!!");
+    }
+
+    @Scheduled(cron = "0 */5 * * * *")
+    public void doPingEveryFiveMinutesUTC() {
+        LOGGER.info("PING!!");
+    }
+
+    @Scheduled(cron = "0 0 0 * * mon", cronZone = "Europe/Paris")
+    public void doPingEveryMondayAtMidnightEuropeParis() {
+        LOGGER.info("PING!!");
+    }
+
+    @Scheduled(initialDelay = 1000)
+    public void doPingOnceAfter1Second() {
+        LOGGER.info("PING!!");
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/sendmail/index.html b/doc/sendmail/index.html new file mode 100644 index 0000000..6ac056f --- /dev/null +++ b/doc/sendmail/index.html @@ -0,0 +1,8 @@ +Void Framework – Sendmail

Sendmail


+ + +
\ No newline at end of file diff --git a/doc/sendmail/mailer-apache-commons-email/index.html b/doc/sendmail/mailer-apache-commons-email/index.html new file mode 100644 index 0000000..39bc478 --- /dev/null +++ b/doc/sendmail/mailer-apache-commons-email/index.html @@ -0,0 +1,14 @@ +Void Framework – Mailer : Apache Commons Email

Mailer : Apache Commons Email

This implementation of the mailer uses the Apache Commons Email library. It allows you to easily send email via SMTP.


Installation

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-sendmail-commonsemail</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

To enable this mailer, you have to set voidframework.sendmail.engine to dev.voidframework.sendmail.engine.ApacheCommonsEmailMailerEngine in your application configuration file.


Configuration

The following configuration keys can be used in the configuration file of your application:

  • voidframework.sendmail.commonsemail.username user name for authentication. The default value is null.
  • voidframework.sendmail.commonsemail.password password for authentication. The default value is null.

This module also includes many of the configuration keys of the Java Mail properties. To use it, simply prefix them with voidframework.sendmail.commonsemail.. Here is the list of possible properties:

https://javaee.github.io/javamail/docs/api/javax/mail/internet/package-summary.html

  • mail.mime.address.usecanonicalhostname
  • mail.mime.allowencodedmessages
  • mail.mime.applefilenames
  • mail.mime.base64.ignoreerrors
  • mail.mime.charset
  • mail.mime.contenttypehandler
  • mail.mime.decodefilename
  • mail.mime.decodeparameters
  • mail.mime.decodetext.strict
  • mail.mime.encodeeol.strict
  • mail.mime.encodefilename
  • mail.mime.encodeparameters
  • mail.mime.foldtext
  • mail.mime.ignoremultipartencoding
  • mail.mime.ignoreunknownencoding
  • mail.mime.ignorewhitespacelines
  • mail.mime.multipart.allowempty
  • mail.mime.multipart.ignoreexistingboundaryparameter
  • mail.mime.multipart.ignoremissingboundaryparameter
  • mail.mime.multipart.ignoremissingendboundary
  • mail.mime.parameters.strict
  • mail.mime.setcontenttypefilename
  • mail.mime.setdefaulttextcharset
  • mail.mime.uudecode.ignoreerrors
  • mail.mime.uudecode.ignoremissingbeginend
  • mail.mime.windowsfilenames

https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html

  • mail.smtp.user
  • mail.smtp.host
  • mail.smtp.port
  • mail.smtp.connectiontimeout
  • mail.smtp.timeout
  • mail.smtp.writetimeout
  • mail.smtp.from
  • mail.smtp.localhost
  • mail.smtp.localaddress
  • mail.smtp.localport
  • mail.smtp.ehlo
  • mail.smtp.auth
  • mail.smtp.auth.mechanisms
  • mail.smtp.auth.login.disable
  • mail.smtp.auth.plain.disable
  • mail.smtp.auth.digest-md5.disable
  • mail.smtp.auth.ntlm.disable
  • mail.smtp.auth.ntlm.domain
  • mail.smtp.auth.ntlm.flags
  • mail.smtp.auth.xoauth2.disable
  • mail.smtp.submitter
  • mail.smtp.dsn.notify
  • mail.smtp.dsn.ret
  • mail.smtp.allow8bitmime
  • mail.smtp.sendpartial
  • mail.smtp.sasl.enable
  • mail.smtp.sasl.mechanisms
  • mail.smtp.sasl.authorizationid
  • mail.smtp.sasl.realm
  • mail.smtp.sasl.usecanonicalhostname
  • mail.smtp.quitwait
  • mail.smtp.reportsuccess
  • mail.smtp.socketFactory
  • mail.smtp.socketFactory.class
  • mail.smtp.socketFactory.fallback
  • mail.smtp.socketFactory.port
  • mail.smtp.ssl.enable
  • mail.smtp.ssl.checkserveridentity
  • mail.smtp.ssl.trust
  • mail.smtp.ssl.socketFactory
  • mail.smtp.ssl.socketFactory.class
  • mail.smtp.ssl.socketFactory.port
  • mail.smtp.ssl.protocols
  • mail.smtp.ssl.ciphersuites
  • mail.smtp.starttls.enable
  • mail.smtp.starttls.required
  • mail.smtp.proxy.host
  • mail.smtp.proxy.port
  • mail.smtp.proxy.user
  • mail.smtp.proxy.password
  • mail.smtp.socks.host
  • mail.smtp.socks.port
  • mail.smtp.mailextension
  • mail.smtp.userset
  • mail.smtp.noop.strict

+ + +
\ No newline at end of file diff --git a/doc/sendmail/mailer-dummy/index.html b/doc/sendmail/mailer-dummy/index.html new file mode 100644 index 0000000..3292ba9 --- /dev/null +++ b/doc/sendmail/mailer-dummy/index.html @@ -0,0 +1,9 @@ +Void Framework – Mailer : Dummy

Mailer : Dummy

This implementation is particularly useful locally during development. It simply displays the email in the console rather than sending a real email.


Installation

To enable this mailer, you have to set voidframework.sendmail.engine to dev.voidframework.sendmail.engine.DummyMailerEngine in your application configuration file.


+ + +
\ No newline at end of file diff --git a/doc/sendmail/sending-emails/index.html b/doc/sendmail/sending-emails/index.html new file mode 100644 index 0000000..6373c49 --- /dev/null +++ b/doc/sendmail/sending-emails/index.html @@ -0,0 +1,34 @@ +Void Framework – Sending emails

Sending emails

If your application needs to send a few emails, you can easily do so via the voidframework-sendmail module. Sending emails is a not blocking operation, the emails are added to a queue that will be consumed asynchronously.


Installation

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-sendmail</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

In addition to this basic module, you will need a mailer implementation. By default, the base module provides an implementation intended for local testing. For normal use, you can for example use the voidframework-sendmail-commonsemail module


Configuration

The following configuration keys can be used in the configuration file of your application:

  • voidframework.sendmail.engine the mailer implementation to use. The default value is null.
  • voidframework.sendmail.mailQueuePollTimeout the time to wait before giving up when retrieving a mail to be sent from the queue of mail waiting to be sent when the queue is empty. The default value is 2 seconds.
  • voidframework.sendmail.gracefulStopTimeout the time for the daemon to shut down properly before it was terminated. The default value is 15 seconds.

Examples

@BindClass
+public final class Service {
+
+    private final Sendmail sendmail;
+
+    @Inject
+    public Service(final Sendmail sendmail) {
+        this.sendmail = sendmail;
+    }
+
+    public void sample() {
+        final Mail mail = new Mail();
+        mail.setSubject("Hello World!");
+        mail.setBodyContentText("Hello World!");
+        mail.setFrom("charlie.root@local.domain", "Charlie Root");
+        mail.addRecipient("john@local.domain");
+
+        sendmail.send(mail);
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/template/freemarker/index.html b/doc/template/freemarker/index.html new file mode 100644 index 0000000..b385a12 --- /dev/null +++ b/doc/template/freemarker/index.html @@ -0,0 +1,16 @@ +Void Framework – FreeMarker

FreeMarker

To generate HTML document with FreeMarker, you have to use the module voidframework-template-freemarker.


Installation

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-template-freemarker</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

Templates location

By default, templates should be placed in the resources/views directory.


Configuration

The following configuration keys can be used in the configuration file of your application:

  • voidframework.template.basePackagePath the location of the templates. The default value is "/views/".

Built-in methods & variables

By default, modules web and template-freemarker provide a set of methods and variables that will be accessible in templates.

MethodDescription
configRetrieves a value from the configuration
displaySizeDisplays a formatted number with the correct unit (Kio, Mio, Gio, …)
i18n / _Translates a message
urlforRetrieves an URL from the router (reverse router)
VariableDescription
isDevModeIndicates whether the application is in dev mode
langContains the current language
languagesContains all available languages
voidFrameworkVersionContains the current Void Framework version

+ + +
\ No newline at end of file diff --git a/doc/template/index.html b/doc/template/index.html new file mode 100644 index 0000000..8c8833e --- /dev/null +++ b/doc/template/index.html @@ -0,0 +1,8 @@ +Void Framework – Template

Template


+ + +
\ No newline at end of file diff --git a/doc/template/using-template/index.html b/doc/template/using-template/index.html new file mode 100644 index 0000000..edc32e8 --- /dev/null +++ b/doc/template/using-template/index.html @@ -0,0 +1,33 @@ +Void Framework – Using template

Using template

Sooner or later you will need to generate documents (HTML, PDF…). Void Framework provides all the tools you need!


Example

public class TemplateExample {
+
+    private final TemplateRenderer templateRenderer;
+
+    @Inject
+    public TemplateExample(final TemplateRenderer templateRenderer) {
+
+        this.templateRenderer = templateRenderer;
+    }
+
+    public void renderTemplate() {
+
+        final Map<String, Object> dataModel = new HashMap<>();
+        dataModel.put("greating.msg", "Hello World!")
+
+        final String result = templateRenderer.render(
+            "renderWithDataModel.ftl",
+            Locale.ENGLISH,
+            dataModel);
+
+        System.out.println(result);
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/testing/index.html b/doc/testing/index.html new file mode 100644 index 0000000..ace3b74 --- /dev/null +++ b/doc/testing/index.html @@ -0,0 +1,8 @@ +Void Framework – Testing

Testing


+ + +
\ No newline at end of file diff --git a/doc/testing/junit-extension/index.html b/doc/testing/junit-extension/index.html new file mode 100644 index 0000000..ecd88f7 --- /dev/null +++ b/doc/testing/junit-extension/index.html @@ -0,0 +1,37 @@ +Void Framework – JUnit's extension

JUnit's extension

It is very important to test the code of an application. Void Framework provides tools for JUnit 5 to run your unit tests in a ready-to-use context as well as with support for Mockito annotations.

To enable this module, just add following lines to the pom.xml file of your project.

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-test</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

JUnit’s extension

The JUnit 5 extension will initialise the Void Framework application and initialise the variables annotated with Mockito annotations. It will also reset the mock between each test. To use it, add the @ExtendWith annotation with the value VoidFrameworkJUnitExtension.class.


Use extra Guice modules

In some situations, you may need to load additional modules for your application to work properly during the unit testing phase. For this, you can use the @ExtraGuiceModule annotation.


Example

@ExtendWith(VoidFrameworkJUnitExtension.class)
+@ExtraGuiceModule({ExtraGuiceModule.class, AnotherExtraGuiceModule.class})
+final class MySimpleUnitTest {
+
+    @Mock
+    private MyRepository myRepository;
+
+    @InjectMock
+    @Spy
+    private MyService myService;
+
+    @Test
+    void myLittleTest() {
+        // Arrange
+        Mockito.when(myRepository.findAll()).thenReturn(Collections.emptyList());
+
+        // Act
+        myService.myMethod();
+
+        // Assert
+        Mockito.verify(myRepository, Mockito.times(1)).findAll();
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/vfs/index.html b/doc/vfs/index.html new file mode 100644 index 0000000..406944b --- /dev/null +++ b/doc/vfs/index.html @@ -0,0 +1,8 @@ +Void Framework – Virtual File Storage

Virtual File Storage


+ + +
\ No newline at end of file diff --git a/doc/vfs/using-vfs/index.html b/doc/vfs/using-vfs/index.html new file mode 100644 index 0000000..5c016d5 --- /dev/null +++ b/doc/vfs/using-vfs/index.html @@ -0,0 +1,60 @@ +Void Framework – Using Virtual File Storage

Using Virtual File Storage

When you need to store or retrieve files, you don’t necessarily want to deal with the complexity or you just want to hide it behind an easy to use interface. Void Framework exposes the VirtualFileStorage interface which allows you to use any storage engine very simply within your application.


Installation

To enable this module, just add following lines to the pom.xml file of your project.

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-vfs</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

Configuration

Different VirtualFileStorage implementations must be configured in voidframework.vfs namespace. The following configuration keys can be used.

  • voidframework.vfs.<name>.className the class name of the VFS implementation to use.
  • voidframework.vfs.<name>.default indicate if the implementation is used by default and can be Guice injected without @Named annotation.


Example

voidframework {
+    vfs {
+
+        memory {
+            className = "dev.voidframework.vfs.engine.MemoryVirtualFileStorage"
+            default = true
+        }
+
+        disk1 {
+            className = "dev.voidframework.vfs.engine.DiskVirtualFileStorage"
+            default = false
+
+            basePath = /tmp/
+        }
+
+        disk2 {
+            className = "dev.voidframework.vfs.engine.DiskVirtualFileStorage"
+            default = false
+
+            basePath = /mount/netstorage/
+        }
+    }
+}
+

Usage

@Singleton
+@WebController(prefixRoute = "/upload")
+public class UploadController {
+
+    private final VirtualFileStorage vfs;
+
+    @Inject
+    public UploadController(final VirtualFileStorage vfs) {
+        
+        this.vfs = vfs;
+    }
+
+    @RequestRoute(method = HttpMethod.POST, name = "uploadFile")
+    public Result uploadFile(final Context context) {
+
+        final FormItem formItem = context.getRequest().getBodyContent().asFormData().getFirst("formFile");
+        if (formItem != null && formItem.fileSize() > 0) {
+            this.vfs.get().storeFile("upload", HttpContentTypes.APPLICATION_OCTET_STREAM, formItem.inputStream());
+        }
+
+        return Result.noContent();
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/web/controller/index.html b/doc/web/controller/index.html new file mode 100644 index 0000000..c328180 --- /dev/null +++ b/doc/web/controller/index.html @@ -0,0 +1,68 @@ +Void Framework – Controller

Controller

Controllers receive incoming web requests, process them and return a result. They are the entry point to your web application. Controllers can return almost any type of data, as long as it is handled by the Result object. It is a convention imposed by Void Framework that methods which handle incoming requests must return a Result.


Example

@Singleton
+@WebController(prefixRoute = "/account")
+public class AccountController {
+
+    @RequestRoute(route = "/(?<accountId>[a-f0-9]+)")
+    public Result showAccount(@RequestPath("accountId") final String accountId) {
+        return Result.ok("Hello World");
+    }
+
+    @RequestRoute(method = HttpMethod.POST, route = "/{accountId}")
+    public Result updateAccount(@RequestPath("accountId") final String accountId,
+                                @RequestBody final ProfileForm form,
+                                final Context context) {
+        return Result.ok("Hello World");
+    }
+}
+

What is a route?

A route consists of three elements: a context path, a prefix and a route itself. The first is configured in the application.conf file via the use of the voidframework.web.contextPath key (default value is /) while the other two are endpoint dependent.


Defining a route

A route is defined by two components, firstly @WebController defines the prefix that will be applied to all methods of the controller and by the @RequestRoute annotation providing various options. The latter tells the Void Framework that the method is an entry point.

@WebController

This annotation is based on the @Controller annotation. It simply allows the class to be better specified and provides additional options. This annotation can only be used at class level.

The annotation accepts the following parameter:

  • prefixRoute a prefix to use on all endpoints in the class. By default, the value is empty.
@RequestRoute

This annotation allows you to configure an entry point that will process an incoming request. This annotation can only be used at method level.

The annotation accepts the following parameters:

  • method the HTTP method. The default value is HttpMethod.GET.
  • route the route. Regular expression with named capturing group or simplified variable (ie: {accountId}) can be used. The default value is /.
  • name an alias name who can be used with the reverse routing. By default, the value is empty.

Retrieving parameters

To work, a controller will probably need some incoming data. To do this, the @RequestPath, @RequestVariable and @RequestBody annotations make it easy to retrieve information from the request. It is also possible to retrieve information from the Context itself.

@RequestPath

This annotation allows you to extract parameters named in the URL path.

The annotation accepts the following parameter:

  • value the name of the parameter (correlated with the regexp used in the route definition) to extract.

@RequestVariable

This annotation allows you to extract query string value (simple or array) from the URI.

The annotation accepts the following parameter:

  • value the name of the query string value to extract.
  • fallback the value to use as fallback.

@RequestBody

This annotation allows you to retrieve the contents of the request (i.e. from a POST query) as a Java object. If something goes wrong, the extracted value will be null.


Example

@Singleton
+@WebController
+public class ExampleController {
+
+    @RequestRoute(route = "/")
+    public Result retrieveArrayFromQueryString(@RequestVariable("year") final int[] yearArray) {
+        return Result.ok(Yaml.toString(yearArray));
+    }
+
+    @RequestRoute(method = HttpMethod.POST, route = "/")
+    public Result retrieveListFromBody(@RequestBody("year") final List<Integer> yearList) {
+        return Result.ok(Yaml.toString(yearList));
+    }
+}
+

Parameter types

It is sure that you will have to retrieve the parameters with their respective type (e.g. int, boolean, …). For this, Void Framework uses the converter mechanism to allow conversion from a String. By default, the following types are handled:

  • Boolean
  • Byte
  • Character
  • CUID
  • Double
  • Float
  • Integer
  • Locale
  • Long
  • Short
  • String
  • UUID

Handle custom types

To handle a new type, you simply have to implement a new converter. For more information, read the Type conversion chapter.


Static assets & webjars

The abstract class AbstractStaticAssetsController provides the methods needed to serve static files and webjars. It provides the reverse routing names static_file and static_webjar. Static files default folder can be changed via the voidframework.web.baseAssetResourcesDirectory configuration key.

@Singleton
+@WebController
+public class StaticAssetsController extends AbstractStaticAssetsController {
+
+    @Inject
+    public StaticAssetsController(final Config configuration) {
+        super(configuration);
+    }
+}
+
<link rel="stylesheet" href="${urlfor('static_file', 'css/application.css')}">
+

JavaScript internationalization (i18n)

If you need to handle client-side translations via JavaScript, the abstract class AbstractJavaScriptInternationalizationController provides an endpoint to retrieve a helper that you can use directly on the client side. It provides the reverse routing name js_i18n.

@Singleton
+@WebController
+public final class JavaScriptInternationalizationController extends AbstractJavaScriptInternationalizationController {
+
+    @Inject
+    public JavaScriptInternationalizationController(final Internationalization internationalization) {
+
+        super(internationalization);
+
+        // Optional: only retrieve matching translations
+        this.filterKeyPatternList.add("footer.*");
+    }
+}
+
<script src="${urlfor('js_i18n', 'fr')}"></script>
+
+<script>
+i18n.getMessage('msg.key');
+i18n.getMessage('msg.key', 'var');
+i18n.getMessage('msg.key', 'var1', 'var2', /*...*/'varn');
+</script>
+

+ + +
\ No newline at end of file diff --git a/doc/web/filters/index.html b/doc/web/filters/index.html new file mode 100644 index 0000000..e43745f --- /dev/null +++ b/doc/web/filters/index.html @@ -0,0 +1,38 @@ +Void Framework – Filters

Filters

Filters are the middleware and are individual functions that make up the request processing pipeline.


Specific filters

The use of filters is done through the use of the @WithFiter annotation. It is possible to specify as many filters as you wish, the order in which they are declared representing the order in which they are used.

@FilterWith({FirstFilter.java, SecondFilter.java})
+@Singleton
+@WebController
+public class Controller {
+
+    @FilterWith({ThirdFilter.java})
+    @RequestRouting
+    public Result showHomePage() {
+        return Result.of("Hello World!");
+    }
+}
+

Global filters

In case the filter have to be enabled globally (it will be used for all requests), it must be declared in the application configuration file with the configuration key voidframework.web.globalFilters :

voidframework {
+    web {
+        globalFilters += "dev.voidframework.web.http.filter.csrf.CSRFFilter"
+    }
+}
+

Passing attributes

If you need to pass values which should not be passed through the session from one filter to another, or simply from a filter to a controller, you can use Context attributes. This is a simple way of passing values while maintaining their type.

@Singleton
+public class ExampleFilter implements Filter {
+
+    private static final TypedMap.Key<UUID> USER_ID = TypedMap.Key.of("USER_ID");
+
+    @Override
+    public Result apply(final Context context, final FilterChain filterChain) {
+        context.getAttributes().put(USER_ID, UUID.randomUUID());
+        
+        return filterChain.applyNext(context);
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/web/index.html b/doc/web/index.html new file mode 100644 index 0000000..d597d33 --- /dev/null +++ b/doc/web/index.html @@ -0,0 +1,8 @@ +Void Framework – Web

Web


+ + +
\ No newline at end of file diff --git a/doc/web/render-template/index.html b/doc/web/render-template/index.html new file mode 100644 index 0000000..e2b710e --- /dev/null +++ b/doc/web/render-template/index.html @@ -0,0 +1,26 @@ +Void Framework – Render template

Render template

The web module also integrates the template module with the Freemarker rendering engine by default. This allows controllers to return html content easily.

Although you can manually use the template engine, in most cases this would not be handy. However, you can use the TemplateResult class which will make it easier to use the renderer.


Built-in methods & variables

By default, the module voidframework-template-freemarker provide a set of methods and variables that will be accessible in templates.

MethodDescription
configRetrieves a value from the configuration
displaySizeDisplays a formatted number with the correct unit (Kio, Mio, Gio, …)
i18n / _Translates a message
urlforRetrieves an URL from the router (reverse router)
VariableDescription
flashContains temporary messages
sessionContains the current session data
isDevModeIndicates whether the application is in dev mode
langContains the current language
languagesContains all available languages
csrfTokenContains the CSRF token
voidFrameworkVersionContains the current Void Framework version

Templates location

Templates should be placed in the resources/views directory.


Static files

If you need to include static files in your HTML page (e.g. css, javascript, image, …), you can use the urlfor method with the first parameter static_file or static_webjar and the second parameter the path to the file.


Example

controller/HomeController.java

@Singleton
+@WebController
+public class HomeController {
+
+    @RequestRouting
+    public Result homepage(final Context ctx) {
+        return Result.ok(
+            TemplateResult.of("homepage.ftl", Map.of("greating", "Hello World")));
+    }
+}
+

resources/views/homepage.ftl

<!DOCTYPE html>
+<html lang="${lang!}">
+    <body>
+      <h1>${greating}</h1>
+      <img src="${urlfor('static_file', 'img/logo.png')}" alt="image"/>
+    </body>
+</html>
+

+ + +
\ No newline at end of file diff --git a/doc/web/security-csrf/index.html b/doc/web/security-csrf/index.html new file mode 100644 index 0000000..5b2836a --- /dev/null +++ b/doc/web/security-csrf/index.html @@ -0,0 +1,16 @@ +Void Framework – CSRF

CSRF

Cross-site request forgery (CSRF), also known as one-click attack or session riding, is a type of malicious vector attack of a website where unauthorized commands are submitted from a user that the web application trusts.

Void Framework provides a CSRF filter that can be applied globally to all requests or only on specific endpoints.


Configuration

The following configuration keys can be used in the configuration file of your application.

  • voidframework.web.csrf.tokenName the token name (used to retrieve token from Body or QueryString). The default value is csrfToken.
  • voidframework.web.csrf.cookieName the name of the cookie containing the current CSRF. The default value is VOID_CSRF.
  • voidframework.web.csrf.cookieHttpOnly is the cookie only be accessed via HTTP? The default value is true.
  • voidframework.web.csrf.cookieSecure is the cookie secured? If true, sent only for HTTPS requests. The default value is false.
  • voidframework.web.csrf.signatureKey the key used to digitally sign the CSRF token. The default value is ${voidframework.web.session.signatureKey}.
  • voidframework.web.csrf.timeToLive the CSRF token TTL. The default value is 15 minutes.

Enable

The activation of the CSRF filter is done via the configuration key voidframework.web.globalFilters. Read more about Filters.

voidframework {
+
+    web {
+        globalFilters += "dev.voidframework.web.http.filter.csrf.CSRFFilter"
+    }
+}
+

@NoCSRF

Although you have enabled the CSRF filter, you may need to disable CSRF protection on a specific endpoint. To do this, you can use the @NoCSRF annotation which will indicate that the CSRF token does not need to be checked.


+ + +
\ No newline at end of file diff --git a/doc/web/security-headers/index.html b/doc/web/security-headers/index.html new file mode 100644 index 0000000..d554e2d --- /dev/null +++ b/doc/web/security-headers/index.html @@ -0,0 +1,16 @@ +Void Framework – Security headers

Security headers

Void Framework provides a basic filter to add certain headers to HTTP responses by default. These headers allow you to add an extra level of security to your application.


Configuration

The following configuration keys can be used in the configuration file of your application.

  • voidframework.web.securityHeaders.contentTypeOptions the value for the header “X-Content-Type-Options”. The default value is nosniff.
  • voidframework.web.securityHeaders.frameOptions the value for the header “X-Frame-Options”. The default value is DENY.
  • voidframework.web.securityHeaders.xssProtection the value for the header “X-XSS-Protection”. The default value is 1; mode=block.
  • voidframework.web.securityHeaders.crossOriginResourcePolicy the value for the header “Cross-Origin-Resource-Policy”. The default value is same-origin.
  • voidframework.web.securityHeaders.contentSecurityPolicy the value for the header “Content-Security-Policy”. The default value is default-src 'self'.

Enable

The activation of the CSRF filter is done via the configuration key voidframework.web.globalFilters. Read more about Filters.

voidframework {
+
+    web {
+        globalFilters += "dev.voidframework.web.http.filter.security.SecurityHeadersFilter"
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/web/session/index.html b/doc/web/session/index.html new file mode 100644 index 0000000..fed6de2 --- /dev/null +++ b/doc/web/session/index.html @@ -0,0 +1,30 @@ +Void Framework – Session

Session

If you need to store data between HTTP requests, you can store it in the session. The data stored in the session is available throughout the user’s session.


Configuration

The following configuration keys can be used in the configuration file of your application.

  • voidframework.web.session.cookieName the name of the cookie containing the current session. The default value is VOID_SESS.
  • voidframework.web.session.cookieHttpOnly is the cookie only be accessed via HTTP? The default value is true.
  • voidframework.web.session.cookieSecure is the cookie secured? If true, sent only for HTTPS requests. The default value is false.
  • voidframework.web.session.signatureKey the key used to digitally sign the session content.
  • voidframework.web.session.timeToLive the session TTL. The default value is 7 days.

Read value

You can access the session data via the Context. Methods get or getOrDefault can be used.

@Singleton
+@WebController
+public class Controller {
+
+    @RequestRouting
+    public Result sessionExample(final Context ctx) {
+        final String userId = ctx.getSession().get("USER_ID");
+        return Result.of(userId);
+    }
+}
+

Store value

To store value(s), methods put, putAll and putIfAbsent can be used.

@Singleton
+@WebController
+public class Controller {
+
+    @RequestRouting
+    public Result sessionExample(final Context ctx) {
+        final String userId = ctx.getSession().put("USER_ID", "e90b88d4-3c15");
+        return Result.of(userId);
+    }
+}
+

+ + +
\ No newline at end of file diff --git a/doc/web/using-web/index.html b/doc/web/using-web/index.html new file mode 100644 index 0000000..418421d --- /dev/null +++ b/doc/web/using-web/index.html @@ -0,0 +1,14 @@ +Void Framework – Using Web

Using Web

Does your application need to have web entry points (ie: http(s) or websocket) to provide an API or web pages? The voidframework-web module will best meet your expectations.


Installation

To enable this module, just add following lines to the pom.xml file of your project.

<dependency>
+    <groupId>dev.voidframework</groupId>
+    <artifactId>voidframework-web</artifactId>
+    <version>1.16.0</version>
+</dependency>
+

Configuration

The following configuration keys can be used.

Base

  • voidframework.web.gracefulStopTimeout the time (duration or milliseconds) for the web daemon to shut down properly. The default value is 15 seconds.
  • voidframework.web.errorHandler the implementation of the error handler to use in case of http error. The default value is dev.voidframework.web.http.errorhandler.DefaultErrorHandler.
  • voidframework.web.contextPath the default context path root. The default value is /.
  • voidframework.web.routes a list of routing definition classes (must implement the interface AppRoutesDefinition). The default value is [].
  • voidframework.web.globalFilters a list of routing global filter classes (must implement the interface Filter). The default value is [].
  • voidframework.web.baseAssetResourcesDirectory the default location of static files in the “resources” directory. The default value is static.

Server

  • voidframework.web.server.idleTimeout the time without any request to wait before the connection is closed. The default value is 30 seconds.
  • voidframework.web.server.extraWebServerConfiguration the implementation of the interface ExtraWebServerConfiguration to apply a custom configuration to the Undertow web server. The default value is null.
  • voidframework.web.server.ioThreads the number of I/O threads. If not specified (value = null or 0), Math.max(Runtime.getRuntime().availableProcessors(), 2) value will be used. The default value is null.
  • voidframework.web.server.workerThreads the number of Worker threads. If not specified (value = null or 0), ioThreadsNumber * 8 value will be used. The default value is null.
  • voidframework.web.server.maxBodySize the max body content size. The default value is 1 MiB.
  • voidframework.web.server.fileSizeThreshold the maximum size allowed in memory before the uploaded file was stored on the disk rather than in memory. The default value is 256 KiB.
  • voidframework.web.server.tempFileLocation the location where temporary files will be stored. The default value is null (default Java temporary folder).

HTTP

  • voidframework.web.server.http.listenHost the interface on which the server will listen for non-secure HTTP requests. The default value is 127.0.0.1.
  • voidframework.web.server.http.listenPort the port on which the server will listen for non-secure HTTP requests. The default value is 9000.

HTTPS

  • voidframework.web.server.https.listenHost the interface on which the server will listen for HTTPS requests. The default value is 127.0.0.1.
  • voidframework.web.server.https.listenPort the port on which the server will listen for HTTPS requests. The default value is 9001.
  • voidframework.web.server.https.ssl.protocols the protocols to use. The default value is ["TLSv1.2", "TLSv1.3"].
  • voidframework.web.server.https.ssl.ciphers the allowed ciphers. If list is empty, all ciphers will be allowed. The default value is [].
  • voidframework.web.server.https.ssl.keyStorePath the path where is located the key store. Could be a “resources” path, a URL or a simple path. The default value is null.
  • voidframework.web.server.https.ssl.keyStoreType the type of the key store. The default value is JKS.
  • voidframework.web.server.https.ssl.keyStorePassword the password to use to open the key store. The default value is null.
  • voidframework.web.server.https.ssl.keyAlias the alias of the key to use. If “null” the key will be choosen automatically. The default value is null.
  • voidframework.web.server.https.ssl.keyPassword the key password. The default value is ${voidframework.web.server.https.ssl.keyStorePassword}.

Language

  • voidframework.web.language.availableLanguages the available languages. The default value is ["en", "fr"].
  • voidframework.web.language.cookieName the name of the cookie containing the current language. The default value is VOID_LANG.
  • voidframework.web.language.cookieHttpOnly if the cookie can only be accessed via HTTP. The default value is false.
  • voidframework.web.language.cookieSecure if the cookie must be secured, if true, the cookie will be only sent via HTTPS. The default value is false.

Flash messages

  • voidframework.web.flashMessages.cookieName the name of the cookie containing the current flash messages. The default value is VOID_FLASH.
  • voidframework.web.flashMessages.cookieHttpOnly if the cookie can only be accessed via HTTP. The default value is false.
  • voidframework.web.flashMessages.cookieSecure if the cookie must be secured, if true, the cookie will be only sent via HTTPS. The default value is false.

Session

  • voidframework.web.session.cookieName the name of the cookie containing the current session. The default value is VOID_SESS.
  • voidframework.web.session.cookieHttpOnly is the cookie only be accessed via HTTP? The default value is true.
  • voidframework.web.session.cookieSecure is the cookie secured? If true, sent only for HTTPS requests. The default value is false.
  • voidframework.web.session.signatureKey the key used to digitally sign the session content.
  • voidframework.web.session.timeToLive the session TTL. The default value is 7 days.

CSRF

  • voidframework.web.csrf.tokenName the token name (used to retrieve token from Body or QueryString). The default value is csrfToken.
  • voidframework.web.csrf.cookieName the name of the cookie containing the current CSRF. The default value is VOID_CSRF.
  • voidframework.web.csrf.cookieHttpOnly is the cookie only be accessed via HTTP? The default value is true.
  • voidframework.web.csrf.cookieSecure is the cookie secured? If true, sent only for HTTPS requests. The default value is false.
  • voidframework.web.csrf.signatureKey the key used to digitally sign the CSRF token. The default value is ${voidframework.web.session.signatureKey}.
  • voidframework.web.csrf.timeToLive the CSRF token TTL. The default value is 15 minutes.

Security headers

  • voidframework.web.securityHeaders.contentTypeOptions the value for the header “X-Content-Type-Options”. The default value is nosniff.
  • voidframework.web.securityHeaders.frameOptions the value for the header “X-Frame-Options”. The default value is DENY.
  • voidframework.web.securityHeaders.xssProtection the value for the header “X-XSS-Protection”. The default value is 1; mode=block.
  • voidframework.web.securityHeaders.crossOriginResourcePolicy the value for the header “Cross-Origin-Resource-Policy”. The default value is same-origin.
  • voidframework.web.securityHeaders.contentSecurityPolicy the value for the header “Content-Security-Policy”. The default value is default-src 'self'.

+ + +
\ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..7891d5e Binary files /dev/null and b/favicon.ico differ diff --git a/index.html b/index.html index 8b13789..ad960e9 100644 --- a/index.html +++ b/index.html @@ -1 +1,9 @@ - +Void Framework

Light and modular Framework for Java

Stay focus on your business



+ + +
\ No newline at end of file diff --git a/index.xml b/index.xml new file mode 100644 index 0000000..32a00d0 --- /dev/null +++ b/index.xml @@ -0,0 +1,135 @@ +Void Frameworkhttps://voidframework.dev/Recent content on Void FrameworkHugo -- gohugo.ioGetting Startedhttps://voidframework.dev/doc/getting-started/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/Getting Startedhttps://voidframework.dev/doc/getting-started/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/Corehttps://voidframework.dev/doc/core/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/Corehttps://voidframework.dev/doc/core/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/Relational Databaseshttps://voidframework.dev/doc/relational-databases/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/Relational Databaseshttps://voidframework.dev/doc/relational-databases/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/NoSQL Databaseshttps://voidframework.dev/doc/nosql-databases/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/nosql-databases/NoSQL Databaseshttps://voidframework.dev/doc/nosql-databases/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/nosql-databases/Cachehttps://voidframework.dev/doc/cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/Cachehttps://voidframework.dev/doc/cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/Internationalizationhttps://voidframework.dev/doc/i18n/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/i18n/Internationalizationhttps://voidframework.dev/doc/i18n/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/i18n/REST Clienthttps://voidframework.dev/doc/rest-client/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/rest-client/REST Clienthttps://voidframework.dev/doc/rest-client/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/rest-client/Schedulerhttps://voidframework.dev/doc/scheduler/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/scheduler/Schedulerhttps://voidframework.dev/doc/scheduler/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/scheduler/Sendmailhttps://voidframework.dev/doc/sendmail/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/Sendmailhttps://voidframework.dev/doc/sendmail/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/Templatehttps://voidframework.dev/doc/template/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/template/Virtual File Storagehttps://voidframework.dev/doc/vfs/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/vfs/Virtual File Storagehttps://voidframework.dev/doc/vfs/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/vfs/Webhttps://voidframework.dev/doc/web/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/Webhttps://voidframework.dev/doc/web/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/Testinghttps://voidframework.dev/doc/testing/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/testing/Testinghttps://voidframework.dev/doc/testing/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/testing/Advancedhttps://voidframework.dev/doc/advanced/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/Advancedhttps://voidframework.dev/doc/advanced/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/Aspect Oriented Programminghttps://voidframework.dev/doc/advanced/aspect-oriented-programming/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/aspect-oriented-programming/Aspect Oriented Programming (AOP) includes programming methods and tools that support the modularization of concerns at the level of the source code. Void Framework manages the AOP via the AspectJ and Guice libraries. The first library is more powerful but also more complicated to use, while the latter has fewer capabilities but is simple to use. +AspectJ AspectJ runtime (aspectjrt) is already provided by the module voidframework-core, but you have to add an extra plugin to compile aspects during the compilation of your application.Aspect Oriented Programminghttps://voidframework.dev/doc/advanced/aspect-oriented-programming/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/aspect-oriented-programming/Aspect Oriented Programming (AOP) includes programming methods and tools that support the modularization of concerns at the level of the source code. Void Framework manages the AOP via the AspectJ and Guice libraries. The first library is more powerful but also more complicated to use, while the latter has fewer capabilities but is simple to use. +AspectJ AspectJ runtime (aspectjrt) is already provided by the module voidframework-core, but you have to add an extra plugin to compile aspects during the compilation of your application.Boot sequencehttps://voidframework.dev/doc/core/boot-sequence/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/boot-sequence/Below is a diagram describing the boot sequence of Void Framework. +S c a N n O C l N a O s s p a S R t o e h r m s t o L t c G o e l u L R a a i o e L d C s ( c a g i o s 3 e d i f l n p a s e o f a ) m G t C c .Boot sequencehttps://voidframework.dev/doc/core/boot-sequence/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/boot-sequence/Below is a diagram describing the boot sequence of Void Framework. +S c a N n O C l N a O s s p a S R t o e h r m s t o L t c G o e l u L R a a i o e L d C s ( c a g i o s 3 e d i f l n p a s e o f a ) m G t C c .Cache engine : In-memoryhttps://voidframework.dev/doc/cache/in-memory-cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/in-memory-cache/This implementation of the cache engine is convenient during the development phase because it avoids the installation of a distributed cache server. However, this implementation is absolutely not recommended for use in a production environment. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-cache&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; To enable In-memory cache engine, you have to set voidframework.cache.engine to dev.voidframework.cache.engine.MemoryCacheEngine in your application configuration file. +Configuration The following configuration key can be used in the configuration file of your application.Cache engine : In-memoryhttps://voidframework.dev/doc/cache/in-memory-cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/in-memory-cache/This implementation of the cache engine is convenient during the development phase because it avoids the installation of a distributed cache server. However, this implementation is absolutely not recommended for use in a production environment. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-cache&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; To enable In-memory cache engine, you have to set voidframework.cache.engine to dev.voidframework.cache.engine.MemoryCacheEngine in your application configuration file. +Configuration The following configuration key can be used in the configuration file of your application.Cache engine : Redishttps://voidframework.dev/doc/cache/redis-cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/redis-cache/This implementation requires the voidframework-redis module to be properly configured. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-cache-redis&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; To enable In-memory cache engine, you have to set voidframework.cache.engine to dev.voidframework.cache.engine.RedisCacheEngine in your application configuration file. +Redis module must be properly configured, read more about Redis configuration.Cache engine : Redishttps://voidframework.dev/doc/cache/redis-cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/redis-cache/This implementation requires the voidframework-redis module to be properly configured. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-cache-redis&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; To enable In-memory cache engine, you have to set voidframework.cache.engine to dev.voidframework.cache.engine.RedisCacheEngine in your application configuration file. +Redis module must be properly configured, read more about Redis configuration.Class scanninghttps://voidframework.dev/doc/core/class-scanning/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/class-scanning/The core of the Void Framework is based on the scanning of different paths to discover elements to load. 5 types of elements are recognised during the scan: +Classes implementing com.google.inject.Module or extending com.google.inject.AbstractModule Classes annotated with Bindable familly annotation Classes implementing defined interface Classes annotated with Aspect annotation Interfaces annotated with Proxyable annotation Guice module Guice modules that extend the abstract class AbstractModule are automatically detected and loaded when the application starts.Class scanninghttps://voidframework.dev/doc/core/class-scanning/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/class-scanning/The core of the Void Framework is based on the scanning of different paths to discover elements to load. 5 types of elements are recognised during the scan: +Classes implementing com.google.inject.Module or extending com.google.inject.AbstractModule Classes annotated with Bindable familly annotation Classes implementing defined interface Classes annotated with Aspect annotation Interfaces annotated with Proxyable annotation Guice module Guice modules that extend the abstract class AbstractModule are automatically detected and loaded when the application starts.Conditional featurehttps://voidframework.dev/doc/core/conditional-feature/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/conditional-feature/Depending on your runtime environment, you may only need to run a few features of your application. And so, load only the necessary modules and bindable classes. +@ConditionalFeature The @ConditionalFeature annotation allows a feature to be enabled or disabled depending on the processing performed by the class supplied as a parameter. This class must implement the Condition interface. +The annotation accepts the following parameter: +value is used to define the implementation of Condition interface to use.Conditional featurehttps://voidframework.dev/doc/core/conditional-feature/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/conditional-feature/Depending on your runtime environment, you may only need to run a few features of your application. And so, load only the necessary modules and bindable classes. +@ConditionalFeature The @ConditionalFeature annotation allows a feature to be enabled or disabled depending on the processing performed by the class supplied as a parameter. This class must implement the Condition interface. +The annotation accepts the following parameter: +value is used to define the implementation of Condition interface to use.Configurationhttps://voidframework.dev/doc/core/configuration/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/configuration/Void Framework use a configuration file format is HOCON (Human-Optimized Config Object Notation). This format supports types such as integer, long, boolean, double, string, list and object. It is also possible to include other files by using include. There are two ways to write comments: using // or #. Comments can be written in-line at the end of the line or in separate lines. For more information on Typesafe Config, visit the Github project&rsquo;s page.Configurationhttps://voidframework.dev/doc/core/configuration/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/configuration/Void Framework use a configuration file format is HOCON (Human-Optimized Config Object Notation). This format supports types such as integer, long, boolean, double, string, list and object. It is also possible to include other files by using include. There are two ways to write comments: using // or #. Comments can be written in-line at the end of the line or in separate lines. For more information on Typesafe Config, visit the Github project&rsquo;s page.Controllerhttps://voidframework.dev/doc/web/controller/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/controller/Controllers receive incoming web requests, process them and return a result. They are the entry point to your web application. Controllers can return almost any type of data, as long as it is handled by the Result object. It is a convention imposed by Void Framework that methods which handle incoming requests must return a Result. +Example +@Singleton @WebController(prefixRoute = &#34;/account&#34;) public class AccountController { @RequestRoute(route = &#34;/(?&lt;accountId&gt;[a-f0-9]+)&#34;) public Result showAccount(@RequestPath(&#34;accountId&#34;) final String accountId) { return Result.Controllerhttps://voidframework.dev/doc/web/controller/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/controller/Controllers receive incoming web requests, process them and return a result. They are the entry point to your web application. Controllers can return almost any type of data, as long as it is handled by the Result object. It is a convention imposed by Void Framework that methods which handle incoming requests must return a Result. +Example +@Singleton @WebController(prefixRoute = &#34;/account&#34;) public class AccountController { @RequestRoute(route = &#34;/(?&lt;accountId&gt;[a-f0-9]+)&#34;) public Result showAccount(@RequestPath(&#34;accountId&#34;) final String accountId) { return Result.Creating a new applicationhttps://voidframework.dev/doc/getting-started/new-application/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/new-application/To create a new application with Void Framework, simply create a new Maven project and then add the necessary dependencies. +Maven The very first dependency to include in your pom.xml is voidframework-core, without it you will not be able to start the application. The dependencies to be added will depend on the features you wish to use on your application, so do not hesitate to consult the different chapters of the documentation.Creating a new applicationhttps://voidframework.dev/doc/getting-started/new-application/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/new-application/To create a new application with Void Framework, simply create a new Maven project and then add the necessary dependencies. +Maven The very first dependency to include in your pom.xml is voidframework-core, without it you will not be able to start the application. The dependencies to be added will depend on the features you wish to use on your application, so do not hesitate to consult the different chapters of the documentation.Creating Modulehttps://voidframework.dev/doc/advanced/creating-module/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/creating-module/Do you want to create a Guice module that will be loaded when your application starts? Nothing could be simpler than creating an implementation of the abstract class AbstractModule or the interface Module. +To meet all needs, the Void Framework provides the ability to obtain additional information via the module&rsquo;s constructor. As a constructor&rsquo;s parameter, you could optionally use the following elements: +Config the current configuration of the application ScannedClassesToLoad the classes that were scanned when the application started if a module needs to be loaded before another, you can use the OrderedModule interface.Creating Modulehttps://voidframework.dev/doc/advanced/creating-module/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/creating-module/Do you want to create a Guice module that will be loaded when your application starts? Nothing could be simpler than creating an implementation of the abstract class AbstractModule or the interface Module. +To meet all needs, the Void Framework provides the ability to obtain additional information via the module&rsquo;s constructor. As a constructor&rsquo;s parameter, you could optionally use the following elements: +Config the current configuration of the application ScannedClassesToLoad the classes that were scanned when the application started if a module needs to be loaded before another, you can use the OrderedModule interface.CSRFhttps://voidframework.dev/doc/web/security-csrf/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/security-csrf/Cross-site request forgery (CSRF), also known as one-click attack or session riding, is a type of malicious vector attack of a website where unauthorized commands are submitted from a user that the web application trusts. +&nbsp; It is recommended that you familiarize yourself with CSRF. We recommend starting with this information from OWASP. Void Framework provides a CSRF filter that can be applied globally to all requests or only on specific endpoints.Data sourcehttps://voidframework.dev/doc/relational-databases/datasource/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/datasource/Your application needs to connect to one or more databases? Void Framework is capable of handling multiple data sources at the same time through the use of DataSourceManager. It will provide all the necessary methods to obtain a connection from the desired data source. Each data source can be configured independently. Your application can, for example, be connected to PostgreSQL and Oracle at the same time. +Installation Void Framework offers different implementations, depending on the implementation chosen, the configuration keys may change.Data sourcehttps://voidframework.dev/doc/relational-databases/datasource/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/datasource/Your application needs to connect to one or more databases? Void Framework is capable of handling multiple data sources at the same time through the use of DataSourceManager. It will provide all the necessary methods to obtain a connection from the desired data source. Each data source can be configured independently. Your application can, for example, be connected to PostgreSQL and Oracle at the same time. +Installation Void Framework offers different implementations, depending on the implementation chosen, the configuration keys may change.Documentationhttps://voidframework.dev/doc/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/Documentationhttps://voidframework.dev/doc/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/Filtershttps://voidframework.dev/doc/web/filters/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/filters/Filters are the middleware and are individual functions that make up the request processing pipeline. +&nbsp; Note that the use of dependencies direct injection is possible in filters. Specific filters The use of filters is done through the use of the @WithFiter annotation. It is possible to specify as many filters as you wish, the order in which they are declared representing the order in which they are used. +@FilterWith({FirstFilter.java, SecondFilter.Filtershttps://voidframework.dev/doc/web/filters/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/filters/Filters are the middleware and are individual functions that make up the request processing pipeline. +&nbsp; Note that the use of dependencies direct injection is possible in filters. Specific filters The use of filters is done through the use of the @WithFiter annotation. It is possible to specify as many filters as you wish, the order in which they are declared representing the order in which they are used. +@FilterWith({FirstFilter.java, SecondFilter.FreeMarkerhttps://voidframework.dev/doc/template/freemarker/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/template/freemarker/To generate HTML document with FreeMarker, you have to use the module voidframework-template-freemarker. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-template-freemarker&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Templates location By default, templates should be placed in the resources/views directory. +Configuration The following configuration keys can be used in the configuration file of your application: +voidframework.template.basePackagePath the location of the templates. The default value is &quot;/views/&quot;. Built-in methods &amp; variables By default, modules web and template-freemarker provide a set of methods and variables that will be accessible in templates.FreeMarkerhttps://voidframework.dev/doc/template/freemarker/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/template/freemarker/To generate HTML document with FreeMarker, you have to use the module voidframework-template-freemarker. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-template-freemarker&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Templates location By default, templates should be placed in the resources/views directory. +Configuration The following configuration keys can be used in the configuration file of your application: +voidframework.template.basePackagePath the location of the templates. The default value is &quot;/views/&quot;. Built-in methods &amp; variables By default, modules web and template-freemarker provide a set of methods and variables that will be accessible in templates.H2https://voidframework.dev/doc/relational-databases/h2/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/h2/H2 is an open-source lightweight relational database. It allows you to quickly have an operational database and its use is very practical during the development phase of an application. This module provides the H2 dependency and the useful H2 web console. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-h2&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration The following configuration keys can be used in the configuration file of your application:H2https://voidframework.dev/doc/relational-databases/h2/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/h2/H2 is an open-source lightweight relational database. It allows you to quickly have an operational database and its use is very practical during the development phase of an application. This module provides the H2 dependency and the useful H2 web console. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-h2&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration The following configuration keys can be used in the configuration file of your application:Hibernatehttps://voidframework.dev/doc/relational-databases/persistence-hibernate/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/persistence-hibernate/Hibernate is an Object Relational Mapper (ORM). It provides a framework for mapping an object-oriented domain model to a relational database. +&nbsp; Void Framework uses Hibernate 6 (or higher), which that means Java persistence is no longer defined by the Java Persistence API under Java EE, but rather by to the Jakarta Persistence 3.0 specification under Jakarta EE. This means the javax.persistence package is no longer available and is replaced by jakarta.Hibernatehttps://voidframework.dev/doc/relational-databases/persistence-hibernate/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/persistence-hibernate/Hibernate is an Object Relational Mapper (ORM). It provides a framework for mapping an object-oriented domain model to a relational database. +&nbsp; Void Framework uses Hibernate 6 (or higher), which that means Java persistence is no longer defined by the Java Persistence API under Java EE, but rather by to the Jakarta Persistence 3.0 specification under Jakarta EE. This means the javax.persistence package is no longer available and is replaced by jakarta.jOOQ ORMhttps://voidframework.dev/doc/relational-databases/persistence-jooq/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/persistence-jooq/jOOQ is an Object Relational Mapper (ORM). It provides a framework for mapping an object-oriented domain model to a relational database. +Installation This module adds support for the Transactional annotation as well as setting up an DSLContext provider pre-configured with all the data sources configured via the datasource module. There is no special configuration to apply, just add the voidframework-persistence-jooq module to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-persistence-jooq&lt;/artifactId&gt; &lt;version&gt;1.jOOQ ORMhttps://voidframework.dev/doc/relational-databases/persistence-jooq/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/persistence-jooq/jOOQ is an Object Relational Mapper (ORM). It provides a framework for mapping an object-oriented domain model to a relational database. +Installation This module adds support for the Transactional annotation as well as setting up an DSLContext provider pre-configured with all the data sources configured via the datasource module. There is no special configuration to apply, just add the voidframework-persistence-jooq module to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-persistence-jooq&lt;/artifactId&gt; &lt;version&gt;1.JUnit's extensionhttps://voidframework.dev/doc/testing/junit-extension/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/testing/junit-extension/It is very important to test the code of an application. Void Framework provides tools for JUnit 5 to run your unit tests in a ready-to-use context as well as with support for Mockito annotations. +To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-test&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; JUnit&rsquo;s extension The JUnit 5 extension will initialise the Void Framework application and initialise the variables annotated with Mockito annotations.JUnit's extensionhttps://voidframework.dev/doc/testing/junit-extension/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/testing/junit-extension/It is very important to test the code of an application. Void Framework provides tools for JUnit 5 to run your unit tests in a ready-to-use context as well as with support for Mockito annotations. +To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-test&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; JUnit&rsquo;s extension The JUnit 5 extension will initialise the Void Framework application and initialise the variables annotated with Mockito annotations.Langhttps://voidframework.dev/doc/core/lang/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/lang/The dev.voidframework.core.lang package contains a set of Java classes that extend the basic JDK. +CUID CUID is a collision-resistant ID optimized for horizontal scaling and performance. Read more at https://usecuid.org/. Read the Java file to get more information about available methods. +// Random CUID final CUID cuid = CUID.randomCUID(); // CUID from String representating a CUID final CUID cuid = CUID.fromString(&#34;cl9gts1kw00393647w1z4v2tc&#34;); // Check if String contains a valid CUID (implicitly called by &#34;fromString&#34; method) final boolean isValid = CUID.Langhttps://voidframework.dev/doc/core/lang/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/lang/The dev.voidframework.core.lang package contains a set of Java classes that extend the basic JDK. +CUID CUID is a collision-resistant ID optimized for horizontal scaling and performance. Read more at https://usecuid.org/. Read the Java file to get more information about available methods. +// Random CUID final CUID cuid = CUID.randomCUID(); // CUID from String representating a CUID final CUID cuid = CUID.fromString(&#34;cl9gts1kw00393647w1z4v2tc&#34;); // Check if String contains a valid CUID (implicitly called by &#34;fromString&#34; method) final boolean isValid = CUID.Life cyclehttps://voidframework.dev/doc/core/life-cycle/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/life-cycle/Void Framework provides a way to manage the life of a component. The @LifeCycleStart and @LifeCycleStop annotations allow you to define the methods to be called automatically when the application is started and stopped. +&nbsp; It is possible to have several methods of a class annotated with the same annotation. @LifeCycleStart Indicates that this method should be called when the application starts. +The annotation accepts the following parameter: +priority is used to define when the method will be called in relation to the others.Life cyclehttps://voidframework.dev/doc/core/life-cycle/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/life-cycle/Void Framework provides a way to manage the life of a component. The @LifeCycleStart and @LifeCycleStop annotations allow you to define the methods to be called automatically when the application is started and stopped. +&nbsp; It is possible to have several methods of a class annotated with the same annotation. @LifeCycleStart Indicates that this method should be called when the application starts. +The annotation accepts the following parameter: +priority is used to define when the method will be called in relation to the others.Mailer : Apache Commons Emailhttps://voidframework.dev/doc/sendmail/mailer-apache-commons-email/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/mailer-apache-commons-email/This implementation of the mailer uses the Apache Commons Email library. It allows you to easily send email via SMTP. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-sendmail-commonsemail&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; To enable this mailer, you have to set voidframework.sendmail.engine to dev.voidframework.sendmail.engine.ApacheCommonsEmailMailerEngine in your application configuration file. +Configuration The following configuration keys can be used in the configuration file of your application: +voidframework.sendmail.commonsemail.username user name for authentication. The default value is null. voidframework.sendmail.commonsemail.password password for authentication.Mailer : Apache Commons Emailhttps://voidframework.dev/doc/sendmail/mailer-apache-commons-email/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/mailer-apache-commons-email/This implementation of the mailer uses the Apache Commons Email library. It allows you to easily send email via SMTP. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-sendmail-commonsemail&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; To enable this mailer, you have to set voidframework.sendmail.engine to dev.voidframework.sendmail.engine.ApacheCommonsEmailMailerEngine in your application configuration file. +Configuration The following configuration keys can be used in the configuration file of your application: +voidframework.sendmail.commonsemail.username user name for authentication. The default value is null. voidframework.sendmail.commonsemail.password password for authentication.Mailer : Dummyhttps://voidframework.dev/doc/sendmail/mailer-dummy/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/mailer-dummy/This implementation is particularly useful locally during development. It simply displays the email in the console rather than sending a real email. +Installation To enable this mailer, you have to set voidframework.sendmail.engine to dev.voidframework.sendmail.engine.DummyMailerEngine in your application configuration file.Mailer : Dummyhttps://voidframework.dev/doc/sendmail/mailer-dummy/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/mailer-dummy/This implementation is particularly useful locally during development. It simply displays the email in the console rather than sending a real email. +Installation To enable this mailer, you have to set voidframework.sendmail.engine to dev.voidframework.sendmail.engine.DummyMailerEngine in your application configuration file.Redishttps://voidframework.dev/doc/nosql-databases/redis/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/nosql-databases/redis/Sometimes a relational database does not fit the need, so you have to turn to more specific, non-relational databases. Void Framework provides the tools to use the NoSQL database Redis. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-redis&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration The following configuration key can be used in the configuration file of your application. +voidframework.redis.host the Redis server host.Redishttps://voidframework.dev/doc/nosql-databases/redis/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/nosql-databases/redis/Sometimes a relational database does not fit the need, so you have to turn to more specific, non-relational databases. Void Framework provides the tools to use the NoSQL database Redis. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-redis&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration The following configuration key can be used in the configuration file of your application. +voidframework.redis.host the Redis server host.reference.confhttps://voidframework.dev/doc/advanced/advanced/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/advanced/The reference.conf files define the various configuration keys and default values. These files are the first to be loaded when the application starts. On this page you will find links to the complete list of reference.conf files used by Void Framework. +voidframework-bucket4j reference.conf voidframework-cache reference.conf voidframework-core reference.conf voidframework-datasource-c3p0 reference.conf voidframework-datasource-hikaricp reference.conf voidframework-healthcheck reference.conf voidframework-i18n reference.conf voidframework-migration-flyway reference.conf voidframework-persistence-hibernate reference.conf voidframework-redis reference.conf voidframework-remoteconf-etcd reference.conf voidframework-remoteconf-http reference.conf voidframework-restclient reference.conf voidframework-scheduler reference.conf voidframework-sendmail reference.reference.confhttps://voidframework.dev/doc/advanced/advanced/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/advanced/advanced/The reference.conf files define the various configuration keys and default values. These files are the first to be loaded when the application starts. On this page you will find links to the complete list of reference.conf files used by Void Framework. +voidframework-bucket4j reference.conf voidframework-cache reference.conf voidframework-core reference.conf voidframework-datasource-c3p0 reference.conf voidframework-datasource-hikaricp reference.conf voidframework-healthcheck reference.conf voidframework-i18n reference.conf voidframework-migration-flyway reference.conf voidframework-persistence-hibernate reference.conf voidframework-redis reference.conf voidframework-remoteconf-etcd reference.conf voidframework-remoteconf-http reference.conf voidframework-restclient reference.conf voidframework-scheduler reference.conf voidframework-sendmail reference.Release noteshttps://voidframework.dev/releasenotes/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/releasenotes/1.16.0 2024-09-17 Security Upgrade undertow version to 2.3.17.Final (CVE-2024-7885) Improved Replace deprecated Bucket4J usage with new API Improved Upgrade dependencies 1.15.0 2024-06-27 Security Upgrade undertow version to 2.3.14.Final (CVE-2024-6162) Improved Upgrade dependencies 1.14.0 2024-05-01 Security Upgrade guava version to 32.0.1 (CVE-2023-2976 & CVE-2020-8908) Fixed Force close BlockingHttpExchange Improved Upgrade dependencies 1.13.0 2024-03-10 New Simplified URL variable Improved Upgrade dependencies 1.12.0 2024-01-02 New Add ClassMethodUtils class Fixed Constants PARENTHESIS_OPEN and PARENTHESIS_CLOSE are no longer inverted Improved Error page (dev mode): display filename & partial content Improved Upgrade dependencies 1.Release noteshttps://voidframework.dev/releasenotes/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/releasenotes/1.16.0 2024-09-17 Security Upgrade undertow version to 2.3.17.Final (CVE-2024-7885) Improved Replace deprecated Bucket4J usage with new API Improved Upgrade dependencies 1.15.0 2024-06-27 Security Upgrade undertow version to 2.3.14.Final (CVE-2024-6162) Improved Upgrade dependencies 1.14.0 2024-05-01 Security Upgrade guava version to 32.0.1 (CVE-2023-2976 & CVE-2020-8908) Fixed Force close BlockingHttpExchange Improved Upgrade dependencies 1.13.0 2024-03-10 New Simplified URL variable Improved Upgrade dependencies 1.12.0 2024-01-02 New Add ClassMethodUtils class Fixed Constants PARENTHESIS_OPEN and PARENTHESIS_CLOSE are no longer inverted Improved Error page (dev mode): display filename & partial content Improved Upgrade dependencies 1.Render templatehttps://voidframework.dev/doc/web/render-template/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/render-template/The web module also integrates the template module with the Freemarker rendering engine by default. This allows controllers to return html content easily. +Although you can manually use the template engine, in most cases this would not be handy. However, you can use the TemplateResult class which will make it easier to use the renderer. +Built-in methods &amp; variables By default, the module voidframework-template-freemarker provide a set of methods and variables that will be accessible in templates.Requirementshttps://voidframework.dev/doc/getting-started/requirements/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/requirements/To use the Void Framework, you need Java JDK 17 or higher, Maven 3 or higher and the Void Framework JAR files. These JAR files are published to the Maven Repository. +Verifying and installing Java To check that you have Java JDK 17 or higher, enter the following in a shell: +#&gt; java -version You should see something like: +openjdk version &#34;17.0.2&#34; 2022-01-18 OpenJDK Runtime Environment (build 17.0.2+8-86) OpenJDK 64-Bit Server VM (build 17.Requirementshttps://voidframework.dev/doc/getting-started/requirements/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/requirements/To use the Void Framework, you need Java JDK 17 or higher, Maven 3 or higher and the Void Framework JAR files. These JAR files are published to the Maven Repository. +Verifying and installing Java To check that you have Java JDK 17 or higher, enter the following in a shell: +#&gt; java -version You should see something like: +openjdk version &#34;17.0.2&#34; 2022-01-18 OpenJDK Runtime Environment (build 17.0.2+8-86) OpenJDK 64-Bit Server VM (build 17.Retrofit 2https://voidframework.dev/doc/rest-client/retrofit2/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/rest-client/retrofit2/Retrofit 2 is a REST Client for Java allowing to retrieve and upload data via HTTP. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-restclient&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; How it work All interfaces annotated with @RestClient will be automatically proxyfied with the Retrofit 2 client. +Configuration The following configuration key can be used in the configuration file of your application +voidframework.restclient.maxIdleConnections the number of connection to keep idle.Retrofit 2https://voidframework.dev/doc/rest-client/retrofit2/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/rest-client/retrofit2/Retrofit 2 is a REST Client for Java allowing to retrieve and upload data via HTTP. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-restclient&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; How it work All interfaces annotated with @RestClient will be automatically proxyfied with the Retrofit 2 client. +Configuration The following configuration key can be used in the configuration file of your application +voidframework.restclient.maxIdleConnections the number of connection to keep idle.Scheduling a local jobhttps://voidframework.dev/doc/scheduler/scheduling-job-cron/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/scheduler/scheduling-job-cron/If your application have to schedule a job in a scheduled way (ie: every 5 seconds), not dependending when the application has started, you can schedule job by using delay. In other hand, if you want a precise scheduling not depending on when the application has started, you can use a CRON expression. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.Scheduling a local jobhttps://voidframework.dev/doc/scheduler/scheduling-job-cron/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/scheduler/scheduling-job-cron/If your application have to schedule a job in a scheduled way (ie: every 5 seconds), not dependending when the application has started, you can schedule job by using delay. In other hand, if you want a precise scheduling not depending on when the application has started, you can use a CRON expression. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.Security headershttps://voidframework.dev/doc/web/security-headers/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/security-headers/Void Framework provides a basic filter to add certain headers to HTTP responses by default. These headers allow you to add an extra level of security to your application. +Configuration The following configuration keys can be used in the configuration file of your application. +voidframework.web.securityHeaders.contentTypeOptions the value for the header &ldquo;X-Content-Type-Options&rdquo;. The default value is nosniff. voidframework.web.securityHeaders.frameOptions the value for the header &ldquo;X-Frame-Options&rdquo;. The default value is DENY. voidframework.web.securityHeaders.xssProtection the value for the header &ldquo;X-XSS-Protection&rdquo;.Sending emailshttps://voidframework.dev/doc/sendmail/sending-emails/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/sending-emails/If your application needs to send a few emails, you can easily do so via the voidframework-sendmail module. Sending emails is a not blocking operation, the emails are added to a queue that will be consumed asynchronously. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-sendmail&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; In addition to this basic module, you will need a mailer implementation. By default, the base module provides an implementation intended for local testing. For normal use, you can for example use the voidframework-sendmail-commonsemail moduleSending emailshttps://voidframework.dev/doc/sendmail/sending-emails/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/sendmail/sending-emails/If your application needs to send a few emails, you can easily do so via the voidframework-sendmail module. Sending emails is a not blocking operation, the emails are added to a queue that will be consumed asynchronously. +Installation &lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-sendmail&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; In addition to this basic module, you will need a mailer implementation. By default, the base module provides an implementation intended for local testing. For normal use, you can for example use the voidframework-sendmail-commonsemail moduleSessionhttps://voidframework.dev/doc/web/session/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/session/If you need to store data between HTTP requests, you can store it in the session. The data stored in the session is available throughout the user&rsquo;s session. +&nbsp; Note that the session is not stored on the server side, but on the client side via the use of a digitally signed Cookie. Because session is implemented using cookies, there are some implications. The data size is limited to 4 KiB Only string can be stored Configuration The following configuration keys can be used in the configuration file of your application.Sessionhttps://voidframework.dev/doc/web/session/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/session/If you need to store data between HTTP requests, you can store it in the session. The data stored in the session is available throughout the user&rsquo;s session. +&nbsp; Note that the session is not stored on the server side, but on the client side via the use of a digitally signed Cookie. Because session is implemented using cookies, there are some implications. The data size is limited to 4 KiB Only string can be stored Configuration The following configuration keys can be used in the configuration file of your application.Transactionalhttps://voidframework.dev/doc/relational-databases/transactional/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/transactional/It is possible to work within a transaction in two ways: manually or via the use of the @Transactional annotation. The first one is highly dependent of the used backend (ie: Hibernate vs jOOQ), the second one is fully handled by Void Framework. For more information on the manual management of transactions, go to the page corresponding to the backend used. +@Transactional The transactional annotation itself defines the scope of a single database transaction.Transactionalhttps://voidframework.dev/doc/relational-databases/transactional/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/relational-databases/transactional/It is possible to work within a transaction in two ways: manually or via the use of the @Transactional annotation. The first one is highly dependent of the used backend (ie: Hibernate vs jOOQ), the second one is fully handled by Void Framework. For more information on the manual management of transactions, go to the page corresponding to the backend used. +@Transactional The transactional annotation itself defines the scope of a single database transaction.Type conversionhttps://voidframework.dev/doc/core/type-conversion/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/type-conversion/Type conversion is a mechanism for converting data from one type to another. For example, convert the string &ldquo;1234&rdquo; to an integer. The conversion is very useful when moving from one layer to another in DDD-based architectures. It is also used in the web feature to convert path param to typed values in the controller. +Using conversion The conversion is used via the Conversion service which is accessible via direct injection.Type conversionhttps://voidframework.dev/doc/core/type-conversion/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/core/type-conversion/Type conversion is a mechanism for converting data from one type to another. For example, convert the string &ldquo;1234&rdquo; to an integer. The conversion is very useful when moving from one layer to another in DDD-based architectures. It is also used in the web feature to convert path param to typed values in the controller. +Using conversion The conversion is used via the Conversion service which is accessible via direct injection.Upgrading from old versionhttps://voidframework.dev/doc/getting-started/upgrading-from-old-version/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/getting-started/upgrading-from-old-version/Sometimes important changes will be introduced that will break the backwards compatibility with older versions of the framework. On this page you will find the necessary steps to make your application work with the latest version. +1.0.0 Initial release +1.1.0 ApplicationLauncher has been renamed to VoidApplication The setting key voidframework.web.session.signatureKey is now required 1.2.0 The CSRF filter has been moved to the dev.voidframework.web.http.filter.csrf package, if you use this filter in your application, you will need to modify the configuration key voidframework.Using cachehttps://voidframework.dev/doc/cache/using-cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/using-cache/Void Framework provides the tools to use a cache system. Caching can be done in two different ways, via the use of annotations or programmatically via the use of the CacheEngine. +&nbsp; If no CacheEngine implementation was specified, the cache will not be active. &nbsp; Note that caching a Result (Web) object can lead to errors during deserialization, especially if Result contains an InputStream. Serialization and deserialization of cached objects is handled by the Kryo library.Using cachehttps://voidframework.dev/doc/cache/using-cache/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/cache/using-cache/Void Framework provides the tools to use a cache system. Caching can be done in two different ways, via the use of annotations or programmatically via the use of the CacheEngine. +&nbsp; If no CacheEngine implementation was specified, the cache will not be active. &nbsp; Note that caching a Result (Web) object can lead to errors during deserialization, especially if Result contains an InputStream. Serialization and deserialization of cached objects is handled by the Kryo library.Using internationalizationhttps://voidframework.dev/doc/internationalization/using-i18n/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/internationalization/using-i18n/Depending on your needs, you may need to use translated messages in different languages. By default the Void Framework provides a ResourceBundle based implementation. If your needs require more advanced management or different storage (ie: DB rather than files), you can easily use your own implementation. +To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-i18n&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Defining messages Translations should be placed in a file named messages_&lt;LANG&gt;.Using internationalizationhttps://voidframework.dev/doc/internationalization/using-i18n/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/internationalization/using-i18n/Depending on your needs, you may need to use translated messages in different languages. By default the Void Framework provides a ResourceBundle based implementation. If your needs require more advanced management or different storage (ie: DB rather than files), you can easily use your own implementation. +To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-i18n&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Defining messages Translations should be placed in a file named messages_&lt;LANG&gt;.Using templatehttps://voidframework.dev/doc/template/using-template/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/template/using-template/Sooner or later you will need to generate documents (HTML, PDF&hellip;). Void Framework provides all the tools you need! +Example public class TemplateExample { private final TemplateRenderer templateRenderer; @Inject public TemplateExample(final TemplateRenderer templateRenderer) { this.templateRenderer = templateRenderer; } public void renderTemplate() { final Map&lt;String, Object&gt; dataModel = new HashMap&lt;&gt;(); dataModel.put(&#34;greating.msg&#34;, &#34;Hello World!&#34;) final String result = templateRenderer.render( &#34;renderWithDataModel.ftl&#34;, Locale.ENGLISH, dataModel); System.out.println(result); } } &nbsp; Note that the data Map must be mutable.Using Virtual File Storagehttps://voidframework.dev/doc/vfs/using-vfs/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/vfs/using-vfs/When you need to store or retrieve files, you don&rsquo;t necessarily want to deal with the complexity or you just want to hide it behind an easy to use interface. Void Framework exposes the VirtualFileStorage interface which allows you to use any storage engine very simply within your application. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-vfs&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration Different VirtualFileStorage implementations must be configured in voidframework.Using Virtual File Storagehttps://voidframework.dev/doc/vfs/using-vfs/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/vfs/using-vfs/When you need to store or retrieve files, you don&rsquo;t necessarily want to deal with the complexity or you just want to hide it behind an easy to use interface. Void Framework exposes the VirtualFileStorage interface which allows you to use any storage engine very simply within your application. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-vfs&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration Different VirtualFileStorage implementations must be configured in voidframework.Using Webhttps://voidframework.dev/doc/web/using-web/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/using-web/Does your application need to have web entry points (ie: http(s) or websocket) to provide an API or web pages? The voidframework-web module will best meet your expectations. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-web&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration The following configuration keys can be used. +Base +voidframework.web.gracefulStopTimeout the time (duration or milliseconds) for the web daemon to shut down properly.Using Webhttps://voidframework.dev/doc/web/using-web/Mon, 01 Jan 0001 00:00:00 +0000https://voidframework.dev/doc/web/using-web/Does your application need to have web entry points (ie: http(s) or websocket) to provide an API or web pages? The voidframework-web module will best meet your expectations. +Installation To enable this module, just add following lines to the pom.xml file of your project. +&lt;dependency&gt; &lt;groupId&gt;dev.voidframework&lt;/groupId&gt; &lt;artifactId&gt;voidframework-web&lt;/artifactId&gt; &lt;version&gt;1.16.0&lt;/version&gt; &lt;/dependency&gt; Configuration The following configuration keys can be used. +Base +voidframework.web.gracefulStopTimeout the time (duration or milliseconds) for the web daemon to shut down properly. \ No newline at end of file diff --git a/js/application.js b/js/application.js new file mode 100644 index 0000000..edf9962 --- /dev/null +++ b/js/application.js @@ -0,0 +1,3 @@ +$('#sidebar-menu').on('change', function() { + $(location).prop('href', this.value); +}); diff --git a/releasenotes/index.html b/releasenotes/index.html new file mode 100644 index 0000000..2c65751 --- /dev/null +++ b/releasenotes/index.html @@ -0,0 +1,36 @@ +Void Framework – Release notes

1.16.0

+2024-09-17

SecurityUpgrade undertow version to 2.3.17.Final (CVE-2024-7885)
ImprovedReplace deprecated Bucket4J usage with new API
ImprovedUpgrade dependencies


1.15.0

+2024-06-27

SecurityUpgrade undertow version to 2.3.14.Final (CVE-2024-6162)
ImprovedUpgrade dependencies


1.14.0

+2024-05-01

SecurityUpgrade guava version to 32.0.1 (CVE-2023-2976 & CVE-2020-8908)
FixedForce close BlockingHttpExchange
ImprovedUpgrade dependencies


1.13.0

+2024-03-10

NewSimplified URL variable
ImprovedUpgrade dependencies


1.12.0

+2024-01-02

NewAdd ClassMethodUtils class
FixedConstants PARENTHESIS_OPEN and PARENTHESIS_CLOSE are no longer inverted
ImprovedError page (dev mode): display filename & partial content
ImprovedUpgrade dependencies


1.11.1

+2023-12-05

SecurityUpgrade logback-classic version to 1.4.14 (CVE-2023-6378)


1.11.1

+2023-11-23

FixedFix SQLDialect detection KO (jOOQ)
FixedFix can't override Hibernate dialect


1.11.0

+2023-10-19

NewAdd KryoUtils class
NewAdd new method ClassResolverUtils::isClassAvailable
NewAdd new Kryo serializers
NewAdd MockitoUtils class (spy lambda)
FixedApplication must shutdown on "start" lifecycle failure
FixedH2 web console fail to start because password not encoded
ImprovedAbstractCacheEngine now using KryoUtils
ImprovedAdd TypedMap static "constructor" methods
ImprovedRedis ACL authentication (username/password)
ImprovedUpgrade dependencies


1.10.0

+2023-09-11

NewREST Client authentication (API Key, Basic, Bearer)
ImprovedNew constant values: CharConstants.EXCLAMATION_MARK, CharConstants.PIPE, StringConstants.EXCLAMATION_MARK and StringConstants.PIPE
ImprovedUpgrade dependencies


1.9.0

+2023-07-13

NewAspectJ
NewREST client
NewBucket4J (rate-limiting)
NewAdd ConfigurationUtils class
ImprovedUpgrade dependencies
ImprovedNew constant value: CharConstants.TAB and StringConstants.TAB


1.8.1

+2023-16-16

ImprovedAdd exception AppLauncherException.ModuleConstructorNotFound


1.8.0

+2023-05-18

NewProxyable interface
NewH2 web console
FixedGuice module implementing interface not recognized
ImprovedBind automatically interface with single implementation
ImprovedUpdated version of all dependencies


1.7.0

+2023-04-12

SecurityUpgrade Undertow version to 2.3.5 (CVE-2022-4492)
NewConditional feature RunInDevModeConditionalFeature
NewSendmail module
NewSendmail module implementation Apache Commons Email
NewAdd @CachePut annotation
FixedTransactional annotation multiple calls
ImprovedJavadoc
ImprovedHttpClient is now used instead of raw URL connection (Remote Configuration)
ImprovedResult: method badRequest(final String content, final String contentType)
ImprovedUpdated version of all dependencies


1.6.1

+2023-02-24

FixedHTTP webserver graceful shutdown not honored


1.6.0

+2023-02-11

NewWeb module can now respond to requests securely via HTTPS
NewNotInstance validation constraint
NewUtility class DurationUtils
ImprovedGraceful stop timeout is now a duration (with time unit)
ImprovedCommercial at "@" constant now available in CharConstants and StringConstants classes
ImprovedAnnotation RequestVariable can now use fallback value
ImprovedUpdated version of all dependencies


1.5.1

+2023-01-07

FixedJavaScript i18n reverse routing name (js_i18n)


1.5.0

+2023-01-02

NewCUID validator
NewInternationalization for JavaScript
NewConditional feature
ImprovedHttp Result methods now accept charset
ImprovedRename bindable annotation from @BindClass to @Bindable
ImprovedClean thread data (Transactional)
ImprovedUpdated version of all dependencies


1.4.0

+2022-12-05

NewGuice module prioritisation
NewjOOQ module
NewWeb context path is now customizable (voidframework.web.contextPath)
ImprovedDeserialization: Unknown enum value to null
ImprovedScheduler "run once" mode
ImprovedStatic files/webjars controller: add route name (static_file and static_webjar)
ImprovedUpdated version of all dependencies


1.3.2

+2022-11-14

FixedNullPointerException when requested config is null on FreeMarker


1.3.1

+2022-11-07

FixedNullPointerException if header Accept-Language not provided


1.3.0

+2022-11-07

SecurityUpgrade Jackson Databind version to 2.14.0 (CVE-2022-42003)
NewWebSocket support
NewCan configure temporary files location (voidframework.web.server.tempFileLocation)
NewMockito annotation support
NewCUID: a Collision-resistant Unique ID
NewAdd HttpHeaderNames class
NewVirtual File Storage
NewNo HTTP request timeout (voidframework.web.server.idleTimeout)
FixedThe abbreviation of "december" is now correct (scheduler)
Fixed"Day of Week" and "Month" can't be zero (Scheduler)
FixedRedis methods addInList, getFromList and decrement now working correctly
FixedForce close all InputStream of uploaded files
FixedCan use template-freemarker without web
ImprovedConfiguration Key/Value from CLI JVM properties (-D flag)
ImprovedAnnotation @RequestVariable can now retrieve array
ImprovedMove cache annotations to subpackage annotation
ImprovedUse wrap/unwrap on Memory cache engine
ImprovedUpdated version of all dependencies
ImprovedRedis parameter connectionTimeout is now a duration
ImprovedRename all utility classes
ImprovedAdd new redirection methods on Result
ImprovedHttpRequestBodyContent::asRaw is now an InputStream
ImprovedRedis::addInList now return the current list size
ImprovedValidationError is now a record

1.2.1

+2022-09-15

FixedThe "Modules loaded" log is displayed too early
FixedRemove unused "GlobalFilterDefinition" interface
ImprovedAdd converter String to Locale (Web). Used to extract Locale from incoming request (route path or query parameter)

1.2.0

+2022-09-05

SecurityUpgrade Undertow version to 2.2.19 (CVE-2022-2053)
NewAdd SecurityHeadersFilter
NewAdd unit test JUnit extension and annotation
NewAdd ability to fetch remote configuration provider & "etcd" remote configuration provider
NewAdd "http" remote configuration provider
NewAdd CharConstants & StringConstants classes
ImprovedForce EntityManagerFactory initialization during boot sequence
ImprovedAdd new Result methods to handle empty content easily
ImprovedValidation constraints can be grouped
ImprovedClean code
ImprovedBetter boolean support (Freemarker / config)
ImprovedRefactoring module "web" (move files, new constant values, unit tests)
ImprovedUpdated version of all dependencies

1.1.2

+2022-08-02

FixedEntityManagerFactory don't find models on multiple-jars project

1.1.1

+2022-07-24

FixedError 500 CSRF when POST request render template
ImprovedChange CSRF signature algorithm to HMACSHA256

1.1.0

+2022-07-22

NewMethods on Reflection util class: getAnnotatedField(Object, Class) and getAnnotatedField(Class, Class)
NewConfiguration keys to define number of I/O and Worker threads (Web)
NewRedis (base + cache + healthcheck)
NewCSRF token
FixedCookie revocation not working
FixedC3P0/HikariCP settings
FixedIssue on routes sorting when regex and capture regex are used
FixedAssets not found when devMode=false
FixedHibernate : Models not found when application is compiled
ImprovedNo longer necessary for HealthChecker to be Singleton
ImprovedAdd cache abstraction helper
ImprovedSession signature key configuration is now required
ImprovedRename ApplicationLauncher to VoidApplication
ImprovedUpdated version of all dependencies

1.0.1

+2022-07-08

NewAbility to retrieve XML body content as Java object
FixedRemoved I18N reference from Hibernate module
FixedTransactional annotation : rollback not occur on unchecked exception
FixedRoutes are randomly sorted
ImprovedCache management : rename the annotation Cache to CacheResult and add CacheRemove

1.0.0

+2022-07-02

Initial release


+ + +
\ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..a7bf303 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1 @@ +https://voidframework.dev/doc/getting-started/https://voidframework.dev/doc/getting-started/https://voidframework.dev/doc/core/https://voidframework.dev/doc/core/https://voidframework.dev/doc/relational-databases/https://voidframework.dev/doc/relational-databases/https://voidframework.dev/doc/nosql-databases/https://voidframework.dev/doc/nosql-databases/https://voidframework.dev/doc/cache/https://voidframework.dev/doc/cache/https://voidframework.dev/doc/i18n/https://voidframework.dev/doc/i18n/https://voidframework.dev/doc/rest-client/https://voidframework.dev/doc/rest-client/https://voidframework.dev/doc/scheduler/https://voidframework.dev/doc/scheduler/https://voidframework.dev/doc/sendmail/https://voidframework.dev/doc/sendmail/https://voidframework.dev/doc/template/https://voidframework.dev/doc/vfs/https://voidframework.dev/doc/vfs/https://voidframework.dev/doc/web/https://voidframework.dev/doc/web/https://voidframework.dev/doc/testing/https://voidframework.dev/doc/testing/https://voidframework.dev/doc/advanced/https://voidframework.dev/doc/advanced/https://voidframework.dev/doc/advanced/aspect-oriented-programming/https://voidframework.dev/doc/advanced/aspect-oriented-programming/https://voidframework.dev/doc/core/boot-sequence/https://voidframework.dev/doc/core/boot-sequence/https://voidframework.dev/doc/cache/in-memory-cache/https://voidframework.dev/doc/cache/in-memory-cache/https://voidframework.dev/doc/cache/redis-cache/https://voidframework.dev/doc/cache/redis-cache/https://voidframework.dev/categories/https://voidframework.dev/doc/core/class-scanning/https://voidframework.dev/doc/core/class-scanning/https://voidframework.dev/doc/core/conditional-feature/https://voidframework.dev/doc/core/conditional-feature/https://voidframework.dev/doc/core/configuration/https://voidframework.dev/doc/core/configuration/https://voidframework.dev/doc/web/controller/https://voidframework.dev/doc/web/controller/https://voidframework.dev/doc/getting-started/new-application/https://voidframework.dev/doc/getting-started/new-application/https://voidframework.dev/doc/advanced/creating-module/https://voidframework.dev/doc/advanced/creating-module/https://voidframework.dev/doc/web/security-csrf/https://voidframework.dev/doc/relational-databases/datasource/https://voidframework.dev/doc/relational-databases/datasource/https://voidframework.dev/doc/https://voidframework.dev/doc/https://voidframework.dev/doc/https://voidframework.dev/doc/web/filters/https://voidframework.dev/doc/web/filters/https://voidframework.dev/doc/template/freemarker/https://voidframework.dev/doc/template/freemarker/https://voidframework.dev/doc/relational-databases/h2/https://voidframework.dev/doc/relational-databases/h2/https://voidframework.dev/doc/relational-databases/persistence-hibernate/https://voidframework.dev/doc/relational-databases/persistence-hibernate/https://voidframework.dev/doc/relational-databases/persistence-jooq/https://voidframework.dev/doc/relational-databases/persistence-jooq/https://voidframework.dev/doc/testing/junit-extension/https://voidframework.dev/doc/testing/junit-extension/https://voidframework.dev/doc/core/lang/https://voidframework.dev/doc/core/lang/https://voidframework.dev/doc/core/life-cycle/https://voidframework.dev/doc/core/life-cycle/https://voidframework.dev/doc/sendmail/mailer-apache-commons-email/https://voidframework.dev/doc/sendmail/mailer-apache-commons-email/https://voidframework.dev/doc/sendmail/mailer-dummy/https://voidframework.dev/doc/sendmail/mailer-dummy/https://voidframework.dev/doc/nosql-databases/redis/https://voidframework.dev/doc/nosql-databases/redis/https://voidframework.dev/doc/advanced/advanced/https://voidframework.dev/doc/advanced/advanced/https://voidframework.dev/releasenotes/https://voidframework.dev/releasenotes/https://voidframework.dev/doc/web/render-template/https://voidframework.dev/doc/getting-started/requirements/https://voidframework.dev/doc/getting-started/requirements/https://voidframework.dev/doc/rest-client/retrofit2/https://voidframework.dev/doc/rest-client/retrofit2/https://voidframework.dev/doc/scheduler/scheduling-job-cron/https://voidframework.dev/doc/scheduler/scheduling-job-cron/https://voidframework.dev/doc/web/security-headers/https://voidframework.dev/doc/sendmail/sending-emails/https://voidframework.dev/doc/sendmail/sending-emails/https://voidframework.dev/doc/web/session/https://voidframework.dev/doc/web/session/https://voidframework.dev/tags/https://voidframework.dev/doc/relational-databases/transactional/https://voidframework.dev/doc/relational-databases/transactional/https://voidframework.dev/doc/core/type-conversion/https://voidframework.dev/doc/core/type-conversion/https://voidframework.dev/doc/getting-started/upgrading-from-old-version/https://voidframework.dev/doc/cache/using-cache/https://voidframework.dev/doc/cache/using-cache/https://voidframework.dev/doc/internationalization/using-i18n/https://voidframework.dev/doc/internationalization/using-i18n/https://voidframework.dev/doc/template/using-template/https://voidframework.dev/doc/vfs/using-vfs/https://voidframework.dev/doc/vfs/using-vfs/https://voidframework.dev/doc/web/using-web/https://voidframework.dev/doc/web/using-web/https://voidframework.dev/ \ No newline at end of file diff --git a/tags/index.xml b/tags/index.xml new file mode 100644 index 0000000..87e8ff1 --- /dev/null +++ b/tags/index.xml @@ -0,0 +1 @@ +Tags on Void Frameworkhttps://voidframework.dev/tags/Recent content in Tags on Void FrameworkHugo -- gohugo.io \ No newline at end of file