From 46d43ff8877aeb20679a5a3efeefd4a96ac61ebd Mon Sep 17 00:00:00 2001 From: Edgar Espina Date: Mon, 16 Oct 2023 20:29:01 -0300 Subject: [PATCH] '3.0.6' --- index.html | 1962 +++++++++++++------------- migration/3.x/index.html | 8 +- modules/avaje-jsonb/index.html | 32 +- modules/aws/index.html | 28 +- modules/caffeine/index.html | 16 +- modules/camel/index.html | 38 +- modules/ebean/index.html | 102 +- modules/flyway/index.html | 40 +- modules/freemarker/index.html | 30 +- modules/graphql/index.html | 94 +- modules/gson/index.html | 32 +- modules/guice/index.html | 34 +- modules/handlebars/index.html | 26 +- modules/hibernate/index.html | 106 +- modules/hikari/index.html | 62 +- modules/jackson/index.html | 56 +- modules/jasypt/index.html | 40 +- modules/jdbi/index.html | 88 +- modules/jstachio/index.html | 50 +- modules/jte/index.html | 36 +- modules/jwt-session-store/index.html | 16 +- modules/kafka/index.html | 20 +- modules/metrics/index.html | 74 +- modules/node/index.html | 34 +- modules/openapi/index.html | 94 +- modules/pac4j/index.html | 96 +- modules/pebble/index.html | 26 +- modules/quartz/index.html | 86 +- modules/redis/index.html | 38 +- modules/rocker/index.html | 44 +- modules/thymeleaf/index.html | 28 +- modules/whoops/index.html | 16 +- modules/yasson/index.html | 32 +- packaging/index.html | 20 +- usage/index.html | 42 +- 35 files changed, 1773 insertions(+), 1773 deletions(-) diff --git a/index.html b/index.html index b4d1f15..41ae8f8 100644 --- a/index.html +++ b/index.html @@ -570,7 +570,7 @@

Welcome to Jooby!

by Edgar Espina
-3.0.5 +3.0.6
Table of Contents
@@ -925,7 +925,7 @@

Welcome!!

Java
Kotlin
-
import io.jooby.Jooby;
+
import io.jooby.Jooby;
 
 public class App extends Jooby {
 
@@ -936,15 +936,15 @@ 

+}
Java
Kotlin
Java
Kotlin
-
import io.jooby.annotation.*;
+
import io.jooby.annotation.*;
 
 public class MyController {
 
@@ -1116,9 +1116,9 @@ 

+}
-

Now type jooby hit ENTER.

+

Now type jooby and hit ENTER.

-

After prompt type help create:

+

After prompt, type help create:

Creates a Maven Kotlin project:
-
jooby> create myapp --kotlin
+
jooby> create myapp --kotlin
@@ -1304,26 +1304,26 @@

Creates a Gradle Java project:
-
jooby> create myapp --gradle
+
jooby> create myapp --gradle
Creates a Gradle Kotlin project:
-
jooby> create myapp --gradle --kotlin
+
jooby> create myapp --gradle --kotlin
-

Maven and Java are the default options but you can easily override those with -g -k or -gk (order doesn’t matter). -Along with the build and language the create command adds two test classes: UnitTest and IntegrationTest.

+

Maven and Java are the default options but you can easily override these with -g -k or -gk (order doesn’t matter). +Along with the build and language, the create command adds two test classes: UnitTest and IntegrationTest.

-

Passing the -m or --mvc generates a MVC application:

+

Passing the -m or --mvc generates an MVC application:

Creates a Maven Java Mvc project:
-
jooby> create myapp --mvc
+
jooby> create myapp --mvc
-

The default package in all these examples is set to app, to get fully control of groupId, package, version, etc…​ Use the interactive mode:

+

The default package in all these examples is set to app. To get full control of groupId, package, version, etc., use the interactive mode:

Interactive mode:
-
jooby> create myapp -i
+
jooby> create myapp -i

2.1. Code Snippets

For simplicity and brevity we are going to skip the runApp function and extending Jooby. -A code example will looks like:

+Code example will look like:

Snippet
Java
Kotlin
-
{
+
{
   get("/", ctx -> "Snippet");
-}
+}
-

The use of application class or runApp function will be included when is strictly necessary.

+

The use of application class or runApp function will be included when strictly necessary.

@@ -1416,7 +1416,7 @@

Routes:
Java
Kotlin
@@ -1613,21 +1613,21 @@

Single path variable:
Java
Kotlin
-
{
+
{
   (1)
   get("/user/{id}", ctx -> {
     int id = ctx.path("id").intValue(); (2)
     return id;
   });
-}
+}
Java
Kotlin
-
{
+
{
   (1)
   get("/file/{file}.{ext}", ctx -> {
     String filename = ctx.path("file").value(); (2)
     String ext = ctx.path("ext").value();   (3)
     return filename + "." + ext;
   });
-}
+}
Java
Kotlin
-
{
+
{
   (1)
   get("/profile/{id}?", ctx -> {
     String id = ctx.path("id").value("self"); (2)
     return id;
   });
-}
+}
Java
Kotlin
-
{
+
{
   (1)
   get("/user/{id:[0-9]+}", ctx -> {
     int id = ctx.path("id").intValue(); (2)
     return id;
   });
-}
+}
Java
Kotlin
-
interface Filter {
+
interface Filter {
   Handler apply(Handler next);
-}
+}
-
interface Before {
+
interface Before {
   void apply(Context ctx);
-}
+}
@@ -2074,16 +2074,16 @@

-
interface After {
+
interface After {
   void apply(Context ctx, Object result, Throwable failure);
-}
+}
Functional Handler:
Java
Kotlin
-
{
+
{
   after((ctx, result, failure) -> {
     System.out.println(result);          (1)
     ctx.setResponseHeader("foo", "bar"); (2)
@@ -2092,9 +2092,9 @@ 

+}
@@ -2128,7 +2128,7 @@

Side-Effect Handler:

Java
Kotlin
-
{
+
{
   after((ctx, result, failure) -> {
     System.out.println(result);          (1)
     ctx.setResponseHeader("foo", "bar"); (2)
@@ -2137,9 +2137,9 @@ 

+}
@@ -2176,7 +2176,7 @@

Safe After:

Java
Kotlin
-
{
+
{
   after((ctx, result, failure) -> {
     if (ctx.isResponseStarted()) {
       // Don't modify response
@@ -2184,9 +2184,9 @@ 

+}
@@ -2220,7 +2220,7 @@

Run code depending of success or failure responses:

Java
Kotlin
-
{
+
{
   after((ctx, result, failure) -> {
     if (failure == null) {
       db.commit();                   (1)
@@ -2228,9 +2228,9 @@ 

(2) } }); -}

+}
@@ -2248,21 +2248,21 @@

Recover fom exception and produces an alternative output:

Java
Kotlin
-
{
+
{
   after((ctx, result, failure) -> {
     if (failure instanceOf MyBusinessException) {
       ctx.send("Recovering from something");        (1)
     }
   });
-}
+}
@@ -2283,7 +2283,7 @@

Suppressed exceptions:

Java
Kotlin
-
{
+
{
   after((ctx, result, failure) -> {
     ...
     throw new AnotherException();
@@ -2298,9 +2298,9 @@ 

(1) Throwable anotherException = failure.getSuppressed()[0]; (2) }); -}

+}
@@ -2345,7 +2345,7 @@

Example

Java
Kotlin
Java
Kotlin
-
{
+
{
   routes(() -> {
 
     get("/", ctx -> "Hello");
 
   });
-}
+}
Java
Kotlin
Java
Kotlin
Java
Kotlin
Java
Kotlin
@@ -2961,7 +2961,7 @@

Dynamic Routing
Java
Kotlin
Java
Kotlin
-
import io.jooby.Jooby;
+
import io.jooby.Jooby;
 ...
 {
 
   setHiddenMethod(ctx -> ctx.header("X-HTTP-Method-Override").toOptional());  (1)
-}
+}
Java
Kotlin
Java
Kotlin
Java
Kotlin
@@ -4038,7 +4038,7 @@

Java
Kotlin
Java
Kotlin
-
{
+
{
   post("/string", ctx -> {
     String body = ctx.body().value();        (1)
     ...
@@ -4727,9 +4727,9 @@ 

(3) ... }); -}

+}
Java
Kotlin
@@ -4880,7 +4880,7 @@

<
Response body
Java
Kotlin
Java
Kotlin
@@ -5061,20 +5061,20 @@

build.gradle
Java
Kotlin
-
tasks.withType(JavaCompile) {
+
tasks.withType(JavaCompile) {
     options.compilerArgs += [
         '-parameters',
         '-Ajooby.incremental=true',
         '-Ajooby.services=true'
     ]
-}
+}
Java
Kotlin
@@ -5183,7 +5183,7 @@

Simple MVC route registration

Java
Kotlin
-
public class App extends Jooby {
+
public class App extends Jooby {
   {
     mvc(new MyController());
   }
@@ -5191,15 +5191,15 @@ 

+}
@@ -5210,7 +5210,7 @@

Class MVC route registration

Java
Kotlin
-
public class App extends Jooby {
+
public class App extends Jooby {
   {
     mvc(MyController.class);
   }
@@ -5218,15 +5218,15 @@ 

+}
@@ -5251,7 +5251,7 @@

Provider MVC route registration

Java
Kotlin
-
import jakarta.inject.Provider;
+
import jakarta.inject.Provider;
 
 public class App extends Jooby {
   {
@@ -5263,9 +5263,9 @@ 

+}
@@ -5300,21 +5300,21 @@

Headers

Java
Kotlin
-
public class MyController {
+
public class MyController {
 
   @GET
   public Object provisioning(@HeaderParam String token) {  (1)
     ...
   }
-}
+}
Java
Kotlin
-
public class MyController {
+
public class MyController {
 
   @GET
   public Object provisioning(@HeaderParam("Last-Modified-Since") long lastModifiedSince) {
     ...
   }
-}
+}
@@ -5360,21 +5360,21 @@