diff --git a/index.html b/index.html index 293e1df..a38fda9 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - + jooby: do more! more easily!! @@ -569,7 +569,7 @@
@@ -980,7 +980,7 @@

-

Latest Release: 3.5.0.

+

Latest Release: 3.5.1.

Looking for a previous version?

@@ -1046,7 +1046,7 @@

Script with sub-class:

Java
Kotlin

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

+}
@@ -1207,7 +1207,7 @@

Creates a Maven Kotlin project:
-
jooby> create myapp --kotlin
+
jooby> create myapp --kotlin
@@ -1330,13 +1330,13 @@

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
Java
Kotlin
-
{
+
{
   get("/", ctx -> "Snippet");
-}
+}
Java
Kotlin
@@ -1639,21 +1639,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);
-}
+}
@@ -2100,16 +2100,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)
@@ -2118,9 +2118,9 @@ 

+}
@@ -2154,7 +2154,7 @@

Side-Effect Handler:

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

+}
@@ -2202,7 +2202,7 @@

Safe After:

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

+}
@@ -2246,7 +2246,7 @@

Run code depending of success or failure responses:

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

(2) } }); -}

+}
@@ -2274,21 +2274,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)
     }
   });
-}
+}
@@ -2309,7 +2309,7 @@

Suppressed exceptions:

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

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

+}
@@ -2371,7 +2371,7 @@

Example

Java
Kotlin
Java
Kotlin
-
{
+
{
   routes(() -> {
 
     get("/", ctx -> "Hello");
 
   });
-}
+}
Java
Kotlin
Java
Kotlin
Java
Kotlin
Java
Kotlin
@@ -2987,7 +2987,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
@@ -4064,7 +4064,7 @@

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

(3) ... }); -}

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

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

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

Simple MVC route registration

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

+}
@@ -5250,21 +5250,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) {
     ...
   }
-}
+}
@@ -5310,21 +5310,21 @@