jooby set -w ~/Source
+jooby set -w ~/Source
diff --git a/index.html b/index.html index 41ae8f8..ec98e85 100644 --- a/index.html +++ b/index.html @@ -570,7 +570,7 @@
import io.jooby.Jooby;
+import io.jooby.Jooby;
public class App extends Jooby {
@@ -936,15 +941,15 @@
+}
Looking for previous version?
+Looking for a previous version?
MVC routes using Jooby or JAX-RS annotations
OpenAPI 3 supports
+OpenAPI 3 support
Event Loop and blocking execution modes
@@ -1003,7 +1008,7 @@Multi-server including Jetty, Netty and Undertow
Jump to full-stack framework with extension/plugin mechanism and variety of modules
+Make the jump to full-stack framework with the extension/plugin mechanism and a variety of modules
Script API (a.k.a script routes) provides a fluent DSL, reflection and annotation free based on lambda
functions.
Script API (a.k.a. script routes) provides a fluent DSL based on lambda
functions, free of
+reflection and annotations.
We usually extend Jooby
and define routes in the instance initializer:
For Java applications we favor extending Jooby
because DSL looks better (no need
-prefix the get
method with a variable)
For Java applications we favor extending Jooby
because the DSL looks better (no need
+to prefix the get
method with a variable).
This is not strictly necessary (of course), you may prefer to do it without extending Jooby
:
This is not strictly necessary (of course); you may prefer to do it without extending Jooby
:
In case of Kotlin, it doesn’t matter which one you choose. DSL looks great with or without extending +
For Kotlin, it doesn’t matter which one you choose. The DSL looks great with or without extending
Kooby
.
The MVC API (a.k.a mvc routes) uses annotation to define routes and byte code generation to execute +
The MVC API (a.k.a. MVC routes) uses annotation to define routes and byte code generation to execute them.
Download jooby-cli.zip
+Download jooby-cli.zip
Unzip jooby-cli.zip
in your user home directory (or any other directory you prefer)
To simplify documentation we use jooby
as command. Windows users must use jooby.bat
To simplify documentation we use jooby
as command, it requires Java 17 as minimum. Windows users must use jooby.bat
jooby set -w ~/Source
+jooby set -w ~/Source
jooby> create myapp
+jooby> create myapp
jooby> create myapp --kotlin
+jooby> create myapp --kotlin
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-kotlin</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
jooby> create myapp --gradle
+jooby> create myapp --gradle
jooby> create myapp --gradle --kotlin
+jooby> create myapp --gradle --kotlin
jooby> create myapp --mvc
+jooby> create myapp --mvc
jooby> create myapp --server undertow
+jooby> create myapp --server undertow
jooby> create myapp --stork
+jooby> create myapp --stork
jooby> create myapp --docker
+jooby> create myapp --docker
jooby> create myapp -i
+jooby> create myapp -i
{
+{
get("/", ctx -> "Snippet");
-}
+}
{
+{
get("/foo", ctx -> "Foo")
.attribute("foo", "bar");
-}
+}
{
+{
use(next -> ctx -> {
User user = ...;
String role = ctx.getRoute().attribute("Role");
@@ -1513,9 +1519,9 @@
+}
@Target({ElementType.METHOD, ElementType.TYPE, ElementType.ANNOTATION_TYPE })
+@Target({ElementType.METHOD, ElementType.TYPE, ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface Role {
String value();
@@ -1555,9 +1561,9 @@
+}
{
+{
get("/foo", ctx -> "Foo");
-}
+}
{
+{
(1)
get("/user/{id}", ctx -> {
int id = ctx.path("id").intValue(); (2)
return id;
});
-}
+}
{
+{
(1)
get("/file/{file}.{ext}", ctx -> {
String filename = ctx.path("file").value(); (2)
String ext = ctx.path("ext").value(); (3)
return filename + "." + ext;
});
-}
+}
{
+{
(1)
get("/profile/{id}?", ctx -> {
String id = ctx.path("id").value("self"); (2)
return id;
});
-}
+}
{
+{
(1)
get("/user/{id:[0-9]+}", ctx -> {
int id = ctx.path("id").intValue(); (2)
return id;
});
-}
+}
{
+{
(1)
get("/articles/*", ctx -> {
String catchall = ctx.path("*").value(); (2)
@@ -1794,9 +1800,9 @@ (3)
return path;
});
-}
+}
{
+{
get("/user/{id}", ctx -> ctx.path("id").value()); (1)
get("/user/me", ctx -> "my profile"); (2)
@@ -1881,9 +1887,9 @@ (3)
get("/users", ctx -> "new users"); (4)
-}
+}
interface Filter {
+interface Filter {
Handler apply(Handler next);
-}
+}
{
+{
use(next -> ctx -> {
long start = System.currentTimeMillis(); (1)
@@ -1958,9 +1964,9 @@ <
get("/", ctx -> {
return "filter";
});
-}
+}
interface Before {
+interface Before {
void apply(Context ctx);
-}
+}
{
+{
before(ctx -> {
ctx.setResponseHeader("Server", "Jooby");
});
@@ -2044,9 +2050,9 @@ <
get("/", ctx -> {
return "...";
});
-}
+}
interface After {
+interface After {
void apply(Context ctx, Object result, Throwable failure);
-}
+}
{
+{
after((ctx, result, failure) -> {
System.out.println(result); (1)
ctx.setResponseHeader("foo", "bar"); (2)
@@ -2137,9 +2143,9 @@
+}
{
+{
after((ctx, result, failure) -> {
if (ctx.isResponseStarted()) {
// Don't modify response
@@ -2184,9 +2190,9 @@
+}
{
+{
after((ctx, result, failure) -> {
if (failure == null) {
db.commit(); (1)
@@ -2228,9 +2234,9 @@ (2)
}
});
-}
+}
{
+{
after((ctx, result, failure) -> {
if (failure instanceOf MyBusinessException) {
ctx.send("Recovering from something"); (1)
}
});
-}
+}
{
+{
after((ctx, result, failure) -> {
...
throw new AnotherException();
@@ -2298,9 +2304,9 @@ (1)
Throwable anotherException = failure.getSuppressed()[0]; (2)
});
-}
+}
{
+{
use(next -> ctx -> {
long start = System.currentTimeInMillis();
ctx.onComplete(context -> { (1)
@@ -2353,9 +2359,9 @@
+}
{
+{
// Increment +1
use(next -> ctx -> {
Number n = (Number) next.apply(ctx);
@@ -2408,9 +2414,9 @@ (1)
get("/2", ctx -> 2); (2)
-}
+}
{
+{
use("/*", (req, rsp, chain) -> {
// remote call, db call
});
// ...
-}
+}
{
+{
// Increment +1
use(next -> ctx -> {
Number n = (Number) next.apply(ctx);
@@ -2538,9 +2544,9 @@ <
});
get("/2", ctx -> 2); (2)
-}
+}
{
+{
// Increment +1
use(next -> ctx -> {
Number n = (Number) next.apply(ctx);
@@ -2606,9 +2612,9 @@ (3)
-}
+}
{
+{
routes(() -> {
get("/", ctx -> "Hello");
});
-}
+}
public class Foo extends Jooby {
+public class Foo extends Jooby {
{
get("/foo", Context::getRequestPath);
}
@@ -2776,9 +2782,9 @@ (3)
}
-}
+}
public class Foo extends Jooby {
+public class Foo extends Jooby {
{
get("/foo", Context::getRequestPath);
}
@@ -2829,9 +2835,9 @@ (1)
}
-}
+}
public class Foo extends Jooby {
+public class Foo extends Jooby {
{
get("/foo", ctx -> ...);
}
@@ -2885,9 +2891,9 @@ (2)
}
-}
+}
{
+{
Foo foo = new Foo();
install(() -> foo); // Won't work
-}
+}
{
+{
install(() -> new Foo()); // Works!
-}
+}
public class V1 extends Jooby {
+public class V1 extends Jooby {
{
get("/api", ctx -> "v1");
}
@@ -2979,9 +2985,9 @@ (2)
}
-}
+}
<form method="post" action="/form">
+<form method="post" action="/form">
<input type="hidden" name="_method" value="put">
-</form>
+</form>
import io.jooby.Jooby;
+import io.jooby.Jooby;
...
{
@@ -3050,9 +3056,9 @@ (2)
});
-}
+}
import io.jooby.Jooby;
+import io.jooby.Jooby;
...
{
setHiddenMethod(ctx -> ctx.header("X-HTTP-Method-Override").toOptional()); (1)
-}
+}
import io.jooby.Jooby;
+import io.jooby.Jooby;
...
{
@@ -3128,9 +3134,9 @@ (5)
...
});
-}
+}
{
+{
get("/", ctx -> { /* do important stuff with variable 'ctx'. */ });
-}
+}
{
+{
setContextAsService(true);
-}
+}
application.lang = en, en-GB, de
+application.lang = en, en-GB, de
{
+{
setLocales(Locale.GERMAN, new Locale("hu", "HU"));
-}
+}
{
+{
get("/{id}" ctx -> ctx.path("id").value()); (1)
get("/@{id}" ctx -> ctx.path("id").value()); (2)
@@ -3405,9 +3411,9 @@ (4)
get("/{id:[0-9]+}", ctx -> ctx.path("id)) (5)
-}
+}
{
+{
get("/{name}", ctx -> {
String pathString = ctx.getRequestPath(); (1)
@@ -3460,9 +3466,9 @@
+}
FileUpload pic = ctx.file("pic"); (1)
+ FileUpload pic = ctx.file("pic"); (1)
List<FileUpload> pic = ctx.files("pic"); (2)
- List<FileUpload> files = ctx.files(); (3)
+ List<FileUpload> files = ctx.files(); (3)
Session session = ctx.session(); (1)
+ Session session = ctx.session(); (1)
- String attribute = ctx.session("attribute").value(); (2)
+ String attribute = ctx.session("attribute").value(); (2)
get("/", ctx -> {
+ get("/", ctx -> {
return ctx.flash("success").value("Welcome!"); (3)
});
post("/save", ctx -> {
ctx.flash("success", "Item created"); (1)
return ctx.sendRedirect("/"); (2)
- });
+ });
{
+{
setFlashCookie(new Cookie("myflash").setHttpOnly(true));
// or if you're fine with the default name
getFlashCookie().setHttpOnly(true);
-}
+}
get("/{foo}", ctx -> {
+get("/{foo}", ctx -> {
String foo = ctx.lookup("foo", ParamSource.QUERY, ParamSource.PATH).value();
return "foo is: " + foo;
});
@@ -4046,9 +4052,9 @@
+});
get("/{foo}", ctx -> {
+get("/{foo}", ctx -> {
List<Certificate> certificates = ctx.getClientCertificates(); (1)
Certificate peerCertificate = certificates.get(0); (2)
-});
+});
{
+{
get("/", ctx -> {
String name = ctx.query("name").value(); (1)
@@ -4145,9 +4151,9 @@ (4)
...
});
-}
+}
{
+{
get("/search", ctx -> {
String q = ctx.query("q").value("*:*"); (1)
return q;
@@ -4264,9 +4270,9 @@ (2)
return q;
});
-}
+}
{
+{
get("/", ctx -> {
Value user = ctx.query("user"); (1)
String name = user.get("name").value(); (2)
@@ -4434,9 +4440,9 @@ (4)
...
}}
-}
+}
class Member {
+class Member {
public final String firstname;
public final String lastName;
@@ -4538,11 +4544,11 @@ PO
this.id = id;
this.members = members;
}
-}
+}
{
+{
get("/", ctx -> {
Member member = ctx.query(Member.class);
...
});
-}
+}
{
+{
get("/", ctx -> {
Member member = ctx.query("member").to(Member.class);
...
});
-}
+}
{
+{
get("/", ctx -> {
List<Member> members = ctx.query().toList(Member.class);
...
});
-}
+}
{
+{
get("/", ctx -> {
Group group = ctx.query(Group.class);
...
});
-}
+}
class Member {
+class Member {
public final String firstname;
public final String lastname;
@@ -4692,9 +4698,9 @@ PO
public Member(@Named("first-name") String firstname, @Named("last-name") String lastname) {
....
}
-}
+}
{
+{
post("/string", ctx -> {
String body = ctx.body().value(); (1)
...
@@ -4727,9 +4733,9 @@ (3)
...
});
-}
+}
public interface MessageDecoder {
+public interface MessageDecoder {
<T> T decode(Context ctx, Type type) throws Exception;
-}
+}
{
+{
FavoriteJson lib = new FavoriteJson(); (1)
decoder(MediaType.json, (ctx, type) -> { (2)
@@ -4800,9 +4806,9 @@ (5)
});
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jackson</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
{
+{
get("/", ctx -> {
ctx.setResponseCode(200); (1)
@@ -4890,9 +4896,9 @@ <
return "Response"; (4)
});
-}
+}
public interface MessageEncoder {
+public interface MessageEncoder {
byte[] encode(@NonNull Context ctx, @NonNull Object value) throws Exception;
-}
+}
{
+{
FavoriteJson lib = new FavoriteJson(); (1)
encoder(MediaType.json, (ctx, result) -> { (2)
@@ -4962,9 +4968,9 @@ (6)
});
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jackson</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
tasks.withType(JavaCompile) {
+tasks.withType(JavaCompile) {
options.compilerArgs += [
'-parameters',
'-Ajooby.incremental=true',
'-Ajooby.services=true'
]
-}
+}
import io.jooby.annotation.*;
+import io.jooby.annotation.*;
@Path("/mvc") (1)
public class Controller {
@@ -5122,9 +5128,9 @@
+}
public class App extends Jooby {
+public class App extends Jooby {
{
mvc(new MyController());
}
@@ -5191,15 +5197,15 @@
+}
public class App extends Jooby {
+public class App extends Jooby {
{
mvc(MyController.class);
}
@@ -5218,15 +5224,15 @@
+}
import jakarta.inject.Provider;
+import jakarta.inject.Provider;
public class App extends Jooby {
{
@@ -5263,9 +5269,9 @@
+}
public class MyController {
+public class MyController {
@GET
public Object provisioning(@HeaderParam String token) { (1)
...
}
-}
+}
public class MyController {
+public class MyController {
@GET
public Object provisioning(@HeaderParam("Last-Modified-Since") long lastModifiedSince) {
...
}
-}
+}
public class MyController {
+public class MyController {
@GET
public Object provisioning(@CookieParam String token) { (1)
...
}
-}
+}
public class MyController {
+public class MyController {
@GET
public Object provisioning(@CookieParam("token-id") String tokenId) {
...
}
-}
+}
public class MyController {
+public class MyController {
@Path("/{id}")
public Object provisioning(@PathParam String id) {
...
}
-}
+}
public class MyController {
+public class MyController {
@Path("/")
public Object provisioning(@QueryParam String q) {
...
}
-}
+}
public class MyController {
+public class MyController {
@Path("/")
@POST
public Object provisioning(@FormParam String username) {
...
}
-}
+}
public class MyController {
+public class MyController {
@Path("/")
@POST
public Object provisioning(MyObject body) {
...
}
-}
+}
public class MyController {
+public class MyController {
@GET
public Object provisioning(@FlashParam String success) { (1)
...
}
-}
+}
public class MyController {
+public class MyController {
@GET
public Object provisioning(@SessionParam String userId) { (1)
...
}
-}
+}
public class MyController {
+public class MyController {
@GET
public Object provisioning(Session session) { (1)
...
}
-}
+}
public class MyController {
+public class MyController {
@GET
public Object provisioning(@ContextParam String userId) { (1)
...
}
-}
+}
public class MyController {
+public class MyController {
@GET
public Object provisioning(@ContextParam Map<String, Object> attributes) { (1)
...
}
-}
+}
public class FooController {
+public class FooController {
@GET("/{foo}")
public String multipleSources(@Param({ QUERY, PATH }) String foo) {
return "foo is: " + foo;
}
-}
+}
public class App extends Jooby {
+public class App extends Jooby {
{
mvc(new MyController());
}
@@ -5799,15 +5805,15 @@ (1)
}
-}
+}
public class App extends Jooby {
+public class App extends Jooby {
{
dispatch(() -> {
mvc(new MyBlockingController()); (1)
@@ -5835,9 +5841,9 @@
+}
public class MyController {
+public class MyController {
@GET("/nonblocking")
public String nonblocking() { (1)
return "I'm nonblocking";
@@ -5875,9 +5881,9 @@ (2)
return "I'm blocking";
}
-}
+}
public class MyController {
+public class MyController {
@GET("/blocking")
@Dispatch("single") (1)
public String blocking() {
return "I'm blocking";
}
-}
+}
{
+{
executor("single", Executors.newSingleThreadExecutor());
mvc(new MyController());
-}
+}
import javax.ws.rs.GET;
+import javax.ws.rs.GET;
import javax.ws.rs.Path;
@Path("/jaxrs")
@@ -5984,9 +5990,9 @@
+}
<plugin>
+ <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
@@ -6092,9 +6098,9 @@
+ </plugin>
{
+{
assets("/static/*"); (1)
-}
+}
{
+{
assets("/static/*", Paths.get("www")); (1)
-}
+}
{
+{
assets("/myfile.js", "/static/myfile.js");
-}
+}
{
+{
Path docs = Paths.get("docs"); (1)
assets("/docs/?*", docs); (2)
-}
+}
{
+{
AssetSource docs = AssetSource.create(Paths.get("docs")); (1)
assets("/docs/?*", new AssetHandler("index.html", docs)); (2)
-}
+}
{
+{
AssetSource www = AssetSource.create(Paths.get("www"));
assets("/static/*", new AssetHandler(www)
.setLastModified(false)
.setEtag(false)
);
-}
+}
{
+{
AssetSource www = AssetSource.create(Paths.get("www"));
assets("/static/*", new AssetHandler(www)
.setMaxAge(Duration.ofDays(365))
);
-}
+}
{
+{
AssetSource www = AssetSource.create(Paths.get("www"));
assets("/static/*", new AssetHandler(www)
.cacheControl(path -> {
@@ -6365,9 +6371,9 @@
+}
{
+{
install(new MyTemplateEngineModule()); (1)
get("/", ctx -> {
Map<String, Object> model = ...; (2)
return new ModelAndView("index.html", model); (3)
});
-}
+}
{
+{
install(new MyTemplateEngineModule());
get("/", ctx -> {
@@ -6445,9 +6451,9 @@ (1)
});
-}
+}
{
+{
install(new HandlebarsModule()); (1)
install(new FreemarkerModule()); (2)
@@ -6517,9 +6523,9 @@ (4)
});
-}
+}
{
+{
get("/", ctx -> {
Session session = ctx.session(); (1)
@@ -6626,9 +6632,9 @@ (3)
});
-}
+}
{
+{
setSessionStore(SessionStore.memory(new Cookie("SESSION"))); (1)
get("/", ctx -> {
@@ -6672,9 +6678,9 @@
+}
{
+{
setSessionStore(SessionStore.memory(SessionToken.header("TOKEN"))); (1)
get("/", ctx -> {
@@ -6712,9 +6718,9 @@
+}
{
+{
setSessionStore(SessionStore.memory(SessionToken.comibe(SessionToken.cookie("SESSION"), SessionToken.header("TOKEN")))); (1)
get("/", ctx -> {
@@ -6752,9 +6758,9 @@
+}
{
+{
String secret = "super secret key"; (1)
setSessionStore(SessionStore.signed(secret)); (2)
@@ -6810,9 +6816,9 @@
+}
{
+{
String secret = "super secret key"; (1)
setSessionStore(SessionStore.signed(secret, SessionToken.header("TOKEN"))); (2)
@@ -6858,9 +6864,9 @@
+}
{
+{
ws("/ws", (ctx, configurer) -> { (1)
configurer.onConnect(ws -> {
ws.send("Connected"); (2)
@@ -6925,9 +6931,9 @@
+}
{
+{
ws("/ws/{key}", (ctx, configurer) -> {
String key = ctx.path("key").value(); (1)
String foo = ctx.session().get("foo").value(); (2)
...
});
-}
+}
import io.jooby.jackson.JacksonModule;
+import io.jooby.jackson.JacksonModule;
{
install(new JackonModule()); (1)
@@ -7030,9 +7036,9 @@ (3)
})
});
-}
+}
import io.jooby.jackson.JacksonModule;
+import io.jooby.jackson.JacksonModule;
{
install(new JackonModule()); (1)
@@ -7080,9 +7086,9 @@
+}
websocket.idleTimeout = 1h
+websocket.idleTimeout = 1h
websocket.maxSize = 128K
+websocket.maxSize = 128K
{
+{
sse("/sse", sse -> { (1)
sse.send("Welcome"); (2)
});
-}
+}
{
+{
sse("/sse", sse -> {
sse.onClose(() -> {
// clean up
});
});
-}
+}
{
+{
sse("/sse", sse -> {
sse.keepAlive(15, TimeUnit.SECONDS)
});
-}
+}
import static io.jooby.ExecutionMode.EVENT_LOOP;
+import static io.jooby.ExecutionMode.EVENT_LOOP;
import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -7321,16 +7327,16 @@
+}
import static io.jooby.ExecutionMode.EVENT_LOOP;
+import static io.jooby.ExecutionMode.EVENT_LOOP;
import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -7373,9 +7379,9 @@
+}
import static io.jooby.ExecutionMode.EVENT_LOOP;
+import static io.jooby.ExecutionMode.EVENT_LOOP;
import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -7434,9 +7440,9 @@
+}
import static io.jooby.ExecutionMode.WORKER;
+import static io.jooby.ExecutionMode.WORKER;
import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -7486,9 +7492,9 @@
+}
import static io.jooby.ExecutionMode.WORKER;
+import static io.jooby.ExecutionMode.WORKER;
import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -7528,9 +7534,9 @@
+}
import static io.jooby.Jooby.runApp;
+import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -7617,9 +7623,9 @@
+}
{
+{
configureServer(server -> {
server.workerThreads(Number);
});
-}
+}
{
+{
get("/json", ctx -> {
ctx.setContentType(MediaType.json);
return "{\"message\": \"Hello Raw Response\"}";
});
-}
+}
{
+{
get("/chunk", ctx -> {
try(Writer writer = ctx.responseWriter()) { (1)
writer.write("chunk1"); (2)
@@ -7839,9 +7845,9 @@ (3)
});
-}
+}
{
+{
get("/chunk", ctx -> {
return ctx.responseWriter(writer -> { (1)
writer.write("chunk1"); (2)
@@ -7885,9 +7891,9 @@
+}
{
+{
get("/download-file", ctx -> {
Path source = Paths.get("logo.png");
return new AttachedFile(source); (1)
@@ -7920,9 +7926,9 @@ (2)
});
-}
+}
FileDownload.Builder produceDownload(Context ctx) {
+FileDownload.Builder produceDownload(Context ctx) {
return FileDownload.build(...);
}
@@ -7963,9 +7969,9 @@
+}
{
+{
mode(EVENT_LOOP); (1)
use(ReactiveSupport.concurrent()); (2)
@@ -8008,9 +8014,9 @@ <
... (4)
});
})
-}
+}
{
+{
mode(WORKER); (1)
use(ReactiveSupport.concurrent()); (2)
@@ -8064,9 +8070,9 @@ <
... (4)
});
})
-}
+}
{
+{
mode(DEFAULT); (1)
use(ReactiveSupport.concurrent()); (2)
@@ -8120,9 +8126,9 @@ <
... (4)
});
})
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-mutiny</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.mutiny;
+import io.jooby.mutiny;
import io.smallrye.mutiny.Uni;
{
@@ -8245,9 +8251,9 @@ Uni
.completionStage(supplyAsync(() -> "Uni"))
.map(it -> "Hello " + it);
})
-}
+}
import io.jooby.mutiny;
+import io.jooby.mutiny;
import io.smallrye.mutiny.Multi;
{
@@ -8280,9 +8286,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-rxjava3</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.rxjava3.Reactivex;
+import io.jooby.rxjava3.Reactivex;
{
use(Reactivex.rx());
@@ -8360,9 +8366,9 @@
+}
import io.jooby.rxjava3.Reactivex;
+import io.jooby.rxjava3.Reactivex;
{
use(Reactivex.rx());
@@ -8391,9 +8397,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-reactor</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.Reactor;
+import io.jooby.Reactor;
{
use(Reactor.reactor());
@@ -8472,9 +8478,9 @@ Mo
.fromCallable(() -> "Mono")
.map(it -> "Hello " + it);
})
-}
+}
import io.jooby.Reactor;
+import io.jooby.Reactor;
{
use(Reactor.reactor())
@@ -8503,9 +8509,9 @@ Fl
return Flux.range(1, 10)
.map(it -> it + ", ");
})
-}
+}
{
+{
coroutine {
get("/") {
delay(100) (1)
"Hello Coroutines!" (2)
}
}
-}
+}
{
+{
coroutine {
get("/") {
ctx.doSomething() (1)
@@ -8588,7 +8594,7 @@ (2)
return "Hello Coroutines!" (3)
-}
+}
{
+{
worker(Executors.newCachedThreadPool())
coroutine {
@@ -8628,7 +8634,7 @@ (3)
}
}
-}
+}
{
+{
coroutine(CoroutineStart.UNDISPATCHED) {
get("/") {
val n = 5 * 5 (1)
@@ -8665,7 +8671,7 @@ (3)
}
}
-}
+}
{
+{
get("/", ctx -> {
return ctx.send("Hello World!");
});
-}
+}
{
+{
errorCode(MyException.class, StatusCode.XXX);
-}
+}
{
+{
error((ctx, cause, statusCode) -> { (1)
Router router = ctx.getRouter();
router.getLog().error("found `{}` error", statusCode.value(), cause); (2)
ctx.setResponseCode(statusCode);
ctx.send("found `" + statusCode.value() + "` error"); (3)
});
-}
+}
import static io.jooby.MediaType.json;
+import static io.jooby.MediaType.json;
import static io.jooby.MediaType.html;
{
@@ -8938,9 +8944,9 @@ (5)
}
});
-}
+}
import static io.jooby.StatusCode.NOT_FOUND;
+import static io.jooby.StatusCode.NOT_FOUND;
{
error(NOT_FOUND, (ctx, cause, statusCode) -> {
ctx.send(statusCode); (1)
});
-}
+}
{
+{
error(MyException.class, (ctx, cause, statusCode) -> {
// log and process MyException
});
-}
+}
import io.jooby.Jooby;
+import io.jooby.Jooby;
import io.jooby.AccessLogHandler;
...
{
@@ -9089,9 +9095,9 @@
+}
import io.jooby.Jooby;
+import io.jooby.Jooby;
import io.jooby.CorsHandler;
...
{
@@ -9202,9 +9208,9 @@
+}
import io.jooby.Jooby;
+import io.jooby.Jooby;
import io.jooby.CorsHandler;
...
{
@@ -9264,9 +9270,9 @@
+}
cors {
+cors {
origin: "*"
credentials: true
methods: [GET, POST],
headers: [Content-Type],
maxAge: 30m
exposedHeaders: [Custom-Header]
-}
+}
<form method="POST" action="...">
+<form method="POST" action="...">
<input name="csrf" value="{{csrf}}" type="hidden" />
...
-</form>
+</form>
import io.jooby.Jooby;
+import io.jooby.Jooby;
import io.jooby.GracefulShutdown;
...
{
@@ -9429,15 +9435,15 @@ (1)
// other routes go here
-}
+}
import io.jooby.Jooby;
+import io.jooby.Jooby;
import io.jooby.HeadHandler;
...
{
@@ -9497,9 +9503,9 @@
+}
<dependency>
+<dependency>
<groupId>com.github.vladimir-bukhtoyarov</groupId>
<artifactId>bucket4j-core</artifactId>
<version>7.6.0</version>
-</dependency>
+</dependency>
{
+{
Bandwidth limit = Bandwidth.simple(10, Duration.ofMinutes(1));
Bucket bucket = Bucket4j.builder().addLimit(limit).build(); (1)
before(new RateLimitHandler(bucket)); (2)
-}
+}
{
+{
before(new RateLimitHandler(remoteAddress -> {
Bandwidth limit = Bandwidth.simple(10, Duration.ofMinutes(1));
return Bucket4j.builder().addLimit(limit).build();
}));
-}
+}
{
+{
before(new RateLimitHandler(key -> {
Bandwidth limit = Bandwidth.simple(10, Duration.ofMinutes(1));
return Bucket4j.builder().addLimit(limit).build();
}, "ApiKey"));
-}
+}
{
+{
Bandwidth limit = Bandwidth.simple(10, Duration.ofMinutes(1));
Bucket bucket = Bucket4j.builder().addLimit(limit).build(); (1)
before(new RateLimitHandler(bucket)); (2)
-}
+}
{
+{
ProxyManager<String> buckets = ...;
before(RateLimitHandler.cluster(key -> {
return buckets.getProxy(key, () -> {
return ...;
});
}));
-}
+}
import io.jooby.Jooby;
+import io.jooby.Jooby;
import io.jooby.TraceHandler;
...
{
@@ -9813,9 +9819,9 @@ <
get("/", ctx -> {
...
});
-}
+}
{
+{
Environment env = getEnvironment();
-}
+}
└── conf
+└── conf
└── application.conf
-└── myapp.jar
+└── myapp.jar
Environment env = getEnvironment();
+ Environment env = getEnvironment();
└── myapp.jar
- └── application.conf (file inside jar)
+└── myapp.jar
+ └── application.conf (file inside jar)
foo = foo
+foo = foo
{
+{
Environment env = getEnvironment(); (1)
Config conf = env.getConfig(); (2)
System.out.println(conf.getString("foo")); (3)
-}
+}
java -jar myapp.jar foo=argument
+java -jar myapp.jar foo=argument
java -Dfoo=sysprop -jar myapp.jar
+java -Dfoo=sysprop -jar myapp.jar
foo=envar java -jar myapp.jar
+foo=envar java -jar myapp.jar
└── application.conf
-└── application.prod.conf
+└── application.conf
+└── application.prod.conf
foo = foo
-bar = devbar
+foo = foo
+bar = devbar
bar = prodbar
+bar = prodbar
{
+{
Environment env = setEnvironmentOptions(new EnvOptions() (1)
.setFilename("myapp.conf")
)
-}
+}
{
+{
Config conf = ConfigFatory.load("/path/to/myapp.conf"); (1)
Environment env = new Env(customConfig, "prod"); (2)
setEnvironment(env); (3)
-}
+}
<dependency>
+<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version></version>
-</dependency>
+</dependency>
<dependency>
+<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version></version>
@@ -10315,17 +10321,17 @@
+</dependency>
conf
+conf
└── logback.conf
-└── logback.prod.conf
+└── logback.prod.conf
public class App extends Jooby {
+public class App extends Jooby {
private static final Logger log = ...
public static void main(String[] args) {
runApp(args, App::new);
}
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-test</artifactId>
<version></version>
-</dependency>
+</dependency>
public class App extends Jooby {
+public class App extends Jooby {
{
get("/", ctx -> "Easy unit testing!");
}
-}
+}
import io.jooby.MockRouter;
+import io.jooby.MockRouter;
public class TestApp {
@@ -10550,9 +10556,9 @@
+}
public class App extends Jooby {
+public class App extends Jooby {
{
get("/", ctx -> ctx
.setResponseCode(StatusCode.OK)
.send("Easy unit testing")
);
}
-}
+}
public class App extends Jooby {
+public class App extends Jooby {
{
post("/", ctx -> {
String name = ctx.form("name").value();
return name;
});
}
-}
+}
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class TestApp {
@@ -10703,9 +10709,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-test</artifactId>
<version></version>
-</dependency>
+</dependency>
public class App extends Jooby {
+public class App extends Jooby {
{
get("/", ctx -> "Easy testing!");
}
-}
+}
import io.jooby.JoobyTest;
+import io.jooby.JoobyTest;
@JoobyTest(App.class)
public class TestApp {
@@ -10820,9 +10826,9 @@
+}
@JoobyTest(App.class)
+@JoobyTest(App.class)
public void test(String serverPath) { (1)
-}
+}
public class App extends Jooby {
+public class App extends Jooby {
public App(String argument) { (1)
get("/", ctx -> "Easy testing!");
}
-}
+}
import io.jooby.JoobyTest;
+import io.jooby.JoobyTest;
public class TestApp {
@@ -10987,9 +10993,9 @@ (2)
return new App("Argument"); (3)
}
-}
+}
<plugins>
+<plugins>
...
<plugin>
<groupId>io.jooby</groupId>
<artifactId>jooby-maven-plugin</artifactId>
- <version>3.0.6</version>
+ <version>3.0.7</version>
</plugin>
...
-</plugins>
+</plugins>
<properties>
+<properties>
<application.class>myapp.App</application.class>
-</properties>
+</properties>
mvn jooby:run
+mvn jooby:run
<plugins>
+<plugins>
...
<plugin>
<groupId>io.jooby</groupId>
<artifactId>jooby-maven-plugin</artifactId>
- <version>3.0.6</version>
+ <version>3.0.7</version>
<configuration>
<mainClass>${application.class}</mainClass> (1)
<restartExtensions>conf,properties,class</restartExtensions> (2)
@@ -11158,16 +11164,16 @@ <
</configuration>
</plugin>
...
-</plugins>
+</plugins>
<build>
+<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
- <version>2.36</version>
+ <version>2.39</version>
<extensions>true</extensions>
<configuration>
<tiles>
- <tile>io.jooby:jooby-stork:3.0.6</tile>
+ <tile>io.jooby:jooby-stork:3.0.7</tile>
</tiles>
</configuration>
</plugin>
</plugins>
-</build>
+</build>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jetty</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-netty</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-undertow</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.netty.NettyServer;
+import io.jooby.netty.NettyServer;
{
install(new NettyServer());
-}
+}
{
+{
setServerOptions(new ServerOptions()
.setBufferSize(16384)
.setCompressionLevel(6)
@@ -11586,9 +11592,9 @@
+}
{
+{
setServerOptions(new ServerOptions()
.setSecurePort(8443) (1)
);
-}
+}
mkcert -pkcs12 localhost
+mkcert -pkcs12 localhost
mkcert localhost
+mkcert localhost
{
+{
SslOptions ssl = SslOptions.x509("path/to/server.crt", "path/to/server.key");
setServerOptions(new ServerOptions()
.setSsl(ssl) (1)
);
-}
+}
server {
+server {
ssl {
type: X509,
cert: "path/to/server.crt",
key: "path/to/server.key"
}
-}
+}
{
+{
setServerOptions(new ServerOptions()
.setSsl(SslOptions.from(getConfig()))
);
-}
+}
{
+{
SslOptions ssl = SslOptions.pkcs12("path/to/server.p12", "password");
setServerOptions(new ServerOptions()
.setSsl(ssl) (1)
);
-}
+}
server {
+server {
ssl {
type: PKCS12,
cert: "path/to/server.p12",
password: "password"
}
-}
+}
{
+{
setServerOptions(new ServerOptions()
.setSsl(SslOptions.from(getConfig()))
);
-}
+}
{
+{
SslOptions ssl = SslOptions.pkcs12("path/to/server.p12", "password")
.setTrustCert(Files.newInputStream("path/to/trustCert")) (1)
.setTrustPassword("password") (2)
@@ -11931,16 +11937,16 @@
+}
{
+{
setServerOptions(new ServerOptions()
.setSsl(SslOptions.from(getConfig()))
);
-}
+}
{
+{
setServerOptions(new ServerOptions()
.setSsl(new SslOptions().setProtocol("TLSv1.3", "TLSv1.2"))
);
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-conscrypt</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
{
+{
setServerOptions(new ServerOptions()
.setHttp2(true)
.setSecurePort(8433)
@@ -12104,9 +12110,9 @@
+}
import io.jooby.Extension;
+import io.jooby.Extension;
public class MyExtension implements Extension {
@@ -12182,9 +12188,9 @@ (4)
}
-}
+}
public class App extends Jooby {
+public class App extends Jooby {
{
install(new MyExtension()); (1)
@@ -12234,9 +12240,9 @@
+}
1) Add Avaje Inject to your project
+<dependency>
+ <groupId>io.avaje</groupId>
+ <artifactId>avaje-inject</artifactId>
+ <version>9.8</version>
+</dependency>
+2) Configure annotation processor
+<build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>...</version>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.avaje</groupId>
+ <artifactId>avaje-inject-generator</artifactId>
+ <version>9.8</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+</build>
+3) Bootstrap Avaje from application:
+import static io.jooby.Jooby.runApp;
+
+public class App extends Jooby {
+
+ {
+ /** Avaje: */
+ BeanScope beanScope = BeanScope.builder() (1)
+ .build();
+
+ MyService service = beanScope.get(MyService.class); (2)
+
+ get("/", ctx -> {
+ return service.doSomething();
+ });
+ }
+
+ public static void main(String[] args) {
+ runApp(args, App::new);
+ }
+}
+1 | +Bootstrap avaje inject bean container | +
2 | +Use Avaje provided objects | +
Integration of MVC routes with Avaje is as simple as:
+import static io.jooby.Jooby.runApp;
+
+public class App extends Jooby {
+
+ {
+ /** Avaje: */
+ BeanScope beanScope = BeanScope.builder() (1)
+ .build();
+
+ mvc(beanScope.get(MyController.class)); (2)
+ }
+
+ public static void main(String[] args) {
+ runApp(args, App::new);
+ }
+}
+1 | +Bootstrap Avaje bean container | +
2 | +Register MVC route provided by Avaje | +
<dependency>
+<dependency>
<groupId>com.google.dagger</groupId>
<artifactId>dagger</artifactId>
<version>2.20</version>
-</dependency>
+</dependency>
import static io.jooby.Jooby.runApp;
+import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -12358,9 +12525,9 @@
+}
+ + | +
+
+
+
|
+
Integration of MVC routes with Dagger is as simple as:
import static io.jooby.Jooby.runApp;
+import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -12411,9 +12593,9 @@
+}
import static io.jooby.Jooby.runApp;
+import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -12461,9 +12643,9 @@
+}
1) Add Guice dependency to your project:
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-guice</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.guice.GuiceModule;
+import io.jooby.guice.GuiceModule;
import io.jooby.kt.runApp;
public class App extends Jooby {
@@ -12531,9 +12713,9 @@
+}
Configuration properties can be injected using the @Named
annotation:
currency = USD
+currency = USD
Guice will also provisioning MVC routes
import io.jooby.guice.GuiceModule;
+import io.jooby.guice.GuiceModule;
import io.jooby.kt.runApp
public class App extends Jooby {
@@ -12616,9 +12798,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-kotlin</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
jooby (core)
io.jooby
io.jooby.test
jooby-test
io.jooby (Kotlin)
io.jooby.kt
removed from jooby, now in jooby-kotlin
jooby-gson
io.jooby.json
io.jooby.jackson
jooby-jackson
io.jooby.di
io.jooby.guice
jooby-guice
{
+{
use("*", (req, rsp, chain) -> {
System.out.println("first");
// Moves execution to next handler: second
@@ -13418,7 +13610,7 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-kotlin</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
jooby (core)
io.jooby
io.jooby.test
jooby-test
io.jooby (Kotlin)
io.jooby.kt
removed from jooby, now in jooby-kotlin
jooby-gson
io.jooby.json
io.jooby.jackson
jooby-jackson
io.jooby.di
io.jooby.guice
jooby-guice
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-avaje-jsonb</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.avaje.jsonb.AvajeJsonbModule;
+import io.jooby.avaje.jsonb.AvajeJsonbModule;
{
install(new AvajeJsonbModule()); (1)
@@ -624,9 +624,9 @@ (3)
...
});
-}
+}
import io.jooby.avaje.jsonb.AvajeJsonbModule;
+import io.jooby.avaje.jsonb.AvajeJsonbModule;
import io.avaje.jsonb.Jsonb;
{
@@ -678,16 +678,16 @@
+}
import io.jooby.avaje.jsonb.AvajeJsonbModule;
+import io.jooby.avaje.jsonb.AvajeJsonbModule;
import io.avaje.jsonb.Jsonb;
{
var jsonb = Jsonb.builder().build();
install(new AvajeJsonbModule(jsonb));
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-awssdk-v1</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<dependency>
+<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
- <version>1.12.566</version>
-</dependency>
+ <version>1.12.626</version>
+</dependency>
aws.accessKeyId = "your access key id"
-aws.secretKey = "your secret key"
+aws.accessKeyId = "your access key id"
+aws.secretKey = "your secret key"
import io.jooby.awssdkv1.AwsModule;
+import io.jooby.awssdkv1.AwsModule;
{
install(
@@ -653,9 +653,9 @@ (4)
})
);
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-caffeine</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.caffeine.CaffeineSessionStore;
+import io.jooby.caffeine.CaffeineSessionStore;
{
setSessionStore(new CaffeineSessionStore()); (1)
@@ -618,9 +618,9 @@ (2)
// work with session
});
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-camel</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.camel.CamelModule;
+import io.jooby.camel.CamelModule;
{
install(new CamelModule(new MyRoutes())); (1)
@@ -632,9 +632,9 @@
+}
myprop = "my prop value"
+myprop = "my prop value"
public class MyRoutes extends RouteBuilder {
+public class MyRoutes extends RouteBuilder {
@Override public void configure() throws Exception {
from("direct://foo")
.log("{{myprop}}");
}
-}
+}
import io.jooby.guice.GuiceModule;
+import io.jooby.guice.GuiceModule;
import io.jooby.camel.CamelModule;
{
@@ -736,9 +736,9 @@ (3)
.log("${body}");
}
-}
+}
camel.main.name = My Camel Context
-camel.threadpool.poolSize = 10
+camel.main.name = My Camel Context
+camel.threadpool.poolSize = 10
<!-- DataSource via HikariCP-->
+<!-- DataSource via HikariCP-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-hikari</artifactId>
- <version>3.0.6</version>
+ <version>3.0.7</version>
</dependency>
<!-- Ebean Module-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-ebean</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>mysql-connector-j</artifactId>
- <version></version>
-</dependency>
+<dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>${mysql-connector-java.version}</version>
+</dependency>
db.url = "jdbc:mysql://localhost/mydb"
+db.url = "jdbc:mysql://localhost/mydb"
db.user = myuser
-db.password = mypass
+db.password = mypass
<plugin>
+<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>${tiles-maven-plugin.version}</version>
@@ -662,22 +662,22 @@
+</plugin>
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
import io.jooby.ebean.EbeanModule;
{
@@ -699,9 +699,9 @@ (3)
// work with Database
});
-}
+}
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
import io.jooby.ebean.EbeanModule;
import io.jooby.ebean.TransactionalRequest;
@@ -763,9 +763,9 @@
+}
import io.jooby.annotation.Transactional;
+import io.jooby.annotation.Transactional;
@Transactional(false)
@GET("/")
public void get(Context ctx) {
// no automatic transaction management here
-}
+}
import io.jooby.ebean.TransactionalRequest;
+import io.jooby.ebean.TransactionalRequest;
{
...
use(new TransactionalRequest().enabledByDefault(false));
...
-}
+}
import io.jooby.annotation.Transactional;
+import io.jooby.annotation.Transactional;
@Inject
private Database database;
@@ -856,9 +856,9 @@
+}
{
+{
get("/", ctx -> {
...
}).attribute(Transactional.ATTRIBUTE, false);
-}
+}
{
+{
DatabaseConfig dbConfig = ...; (1)
install(new EbeanModule(dbConfig)); (2)
-}
+}
{
+{
ebean {
ddl {
generate = true
run = true
}
}
-}
+}
<!-- DataSource via HikariCP-->
+<!-- DataSource via HikariCP-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-hikari</artifactId>
- <version>3.0.6</version>
+ <version>3.0.7</version>
</dependency>
<!-- Flyway Module-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-flyway</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>mysql-connector-j</artifactId>
- <version></version>
-</dependency>
+<dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>${mysql-connector-java.version}</version>
+</dependency>
db.url = "jdbc:mysql://localhost/mydb"
+db.url = "jdbc:mysql://localhost/mydb"
db.user = myuser
-db.password = mypass
+db.password = mypass
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
import io.jooby.flyway.FlywayModule;
{
@@ -657,16 +657,16 @@ (2)
-}
+}
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
import io.jooby.flyway.FlywayModule;
{
@@ -722,9 +722,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-freemarker</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<p> Hello ${name}! </p>
+<p> Hello ${name}! </p>
import io.jooby.freemarker.FreemarkerModule;
+import io.jooby.freemarker.FreemarkerModule;
{
install(new FreemarkerModule());
@@ -630,9 +630,9 @@
+}
freemarker.cacheStorage = soft
-freemarker.strictSyntax = yes
+freemarker.cacheStorage = soft
+freemarker.strictSyntax = yes
import io.jooby.freemarker.FreemarkerModule;
+import io.jooby.freemarker.FreemarkerModule;
{
Configuration freemarker = new Configuration();
install(new FreemarkerModule(freemarker));
-}
+}
<!-- GraphQL-->
+<!-- GraphQL-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-graphql</artifactId>
- <version>3.0.6</version>
+ <version>3.0.7</version>
</dependency>
<!-- JSON library-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jackson</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.json.JacksonModule;
+import io.jooby.json.JacksonModule;
import io.jooby.graphql.GraphQLModule;
{
@@ -672,9 +672,9 @@
+}
import io.jooby.json.JacksonModule;
+import io.jooby.json.JacksonModule;
import io.jooby.graphql.GraphQLModule;
{
install(new GraphQLModule(...)
.setSupportHttpGet(true)
);
-}
+}
<!-- JSON library-->
+<!-- JSON library-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jackson</artifactId>
- <version>3.0.6</version>
+ <version>3.0.7</version>
</dependency>
<!-- GraphQL-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-graphql</artifactId>
- <version>3.0.6</version>
+ <version>3.0.7</version>
</dependency>
<!-- GraphIQL-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-graphiql</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.json.JacksonModule;
+import io.jooby.json.JacksonModule;
import io.jooby.graphql.GraphQLModule;
import io.jooby.graphql.GraphiQLModule;
@@ -861,9 +861,9 @@ (2)
install(new GraphiQLModule()); (3)
-}
+}
<!-- JSON library-->
+<!-- JSON library-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jackson</artifactId>
- <version>3.0.6</version>
+ <version>3.0.7</version>
</dependency>
<!-- GraphQL-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-graphql</artifactId>
- <version>3.0.6</version>
+ <version>3.0.7</version>
</dependency>
<!-- GraphQL Playground-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-graphiql-playground</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.json.JacksonModule;
+import io.jooby.json.JacksonModule;
import io.jooby.graphql.GraphQLModule;
import io.jooby.graphql.GraphQLPlaygroundModule;
@@ -953,9 +953,9 @@ (2)
install(new GraphQLPlaygroundModule()); (3)
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-gson</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.json.GsonModule;
+import io.jooby.json.GsonModule;
{
install(new GsonModule()); (1)
@@ -624,9 +624,9 @@ (3)
...
});
-}
+}
import io.jooby.json.GsonModule;
+import io.jooby.json.GsonModule;
{
install(new GsonModule());
@@ -677,15 +677,15 @@
+}
import io.jooby.json.GsonModule;
+import io.jooby.json.GsonModule;
{
Gson gson = new GsonBuilder().create();
install(new GsonModule(gson));
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-guice</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.guice.GuiceModule;
+import io.jooby.guice.GuiceModule;
import io.jooby.kt.runApp;
public class App extends Jooby {
@@ -621,9 +621,9 @@
+}
currency = USD
+currency = USD
import io.jooby.guice.GuiceModule;
+import io.jooby.guice.GuiceModule;
import io.jooby.kt.runApp
public class App extends Jooby {
@@ -706,9 +706,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-handlebars</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<p> Hello {{name}}! </p>
+<p> Hello {{name}}! </p>
import io.jooby.handlebars.HandlebarsModule;
+import io.jooby.handlebars.HandlebarsModule;
{
install(new HandlebarsModule());
@@ -630,9 +630,9 @@
+}
import io.jooby.handlebars.HandlebarsModule;
+import io.jooby.handlebars.HandlebarsModule;
{
Handlebars handlebars = new Handlebars();
@@ -683,9 +683,9 @@
+}
<!-- DataSource via HikariCP-->
+<!-- DataSource via HikariCP-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-hikari</artifactId>
- <version>3.0.6</version>
+ <version>3.0.7</version>
</dependency>
<!-- Hibernate Module-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-hibernate</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>mysql-connector-j</artifactId>
- <version></version>
-</dependency>
+<dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>${mysql-connector-java.version}</version>
+</dependency>
db.url = "jdbc:mysql://localhost/mydb"
+db.url = "jdbc:mysql://localhost/mydb"
db.user = myuser
-db.password = mypass
+db.password = mypass
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
import io.jooby.hibernate.HibernateModule;
{
install(new HikariModule()); (1)
@@ -682,9 +682,9 @@ (9)
}
});
-}
+}
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
import io.jooby.hibernate.HibernateModule;
import io.jooby.hibernate.TransactionalRequest;
@@ -816,9 +816,9 @@
+}
import io.jooby.annotation.Transactional;
+import io.jooby.annotation.Transactional;
@Transactional(false)
@GET("/")
public void get(Context ctx) {
// no automatic transaction management here
-}
+}
import io.jooby.ebean.TransactionalRequest;
+import io.jooby.ebean.TransactionalRequest;
{
...
use(new TransactionalRequest().enabledByDefault(false));
...
-}
+}
import io.jooby.annotation.Transactional;
+import io.jooby.annotation.Transactional;
@Inject
private EntityManager entityManager;
@@ -933,9 +933,9 @@
+}
{
+{
get("/", ctx -> {
...
}).attribute(Transactional.ATTRIBUTE, false);
-}
+}
{
+{
get("/pets", ctx -> require(UnitOfWork.class)
.apply(em -> em.createQuery("from Pet", Pet.class).getResultList()));
-}
+}
{
+{
get("/update", ctx -> require(UnitOfWork.class)
.apply((em, txh) -> {
em.createQuery("from Pet", Pet.class).getResultList().forEach(pet -> {
@@ -1023,9 +1023,9 @@
+}
{
+{
use(new TransactionalRequest());
// will lead to exception
get("/nope", ctx -> require(UnitOfWork.class)
.apply(em -> em.createQuery("from Pet", Pet.class).getResultList()));
-}
+}
hibernate.hbm2ddl.auto = create
+hibernate.hbm2ddl.auto = create
{
+{
install(new HibernateModule().with(builder -> {
return builder
.flushMode(AUTO)
.openSession();
}));
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-hikari</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>mysql-connector-j</artifactId>
- <version></version>
-</dependency>
+<dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>${mysql-connector-java.version}</version>
+</dependency>
db.url = "jdbc:mysql://localhost/mydb"
+db.url = "jdbc:mysql://localhost/mydb"
db.user = myuser
-db.password = mypass
+db.password = mypass
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
{
install(new HikariModule());
@@ -649,9 +649,9 @@
+}
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
{
install(new HikariModule("mydb"));
-}
+}
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
{
install(new HikariModule("jdbc:mysql://localhost/mydb"));
-}
+}
maindb.url = "jdbc:mysql://localhost/main"
+maindb.url = "jdbc:mysql://localhost/main"
maindb.user = myuser
maindb.password = mypass
auditdb.url = "jdbc:mysql://localhost/audit"
auditdb.user = myuser
-auditdb.password = mypass
+auditdb.password = mypass
db.url = "jdbc:mysql://localhost/main"
+db.url = "jdbc:mysql://localhost/main"
db.user = myuser
-hikari.maximumPoolSize = 10
+hikari.maximumPoolSize = 10
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jackson</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.json.JacksonModule;
+import io.jooby.json.JacksonModule;
{
install(new JacksonModule()); (1)
@@ -625,9 +625,9 @@ (3)
...
});
-}
+}
import io.jooby.json.JacksonModule;
+import io.jooby.json.JacksonModule;
{
install(new JacksonModule());
@@ -678,15 +678,15 @@
+}
import io.jooby.json.JacksonModule;
+import io.jooby.json.JacksonModule;
{
ObjectMapper mapper = new ObjectMapper();
install(new JacksonModule(mapper));
-}
+}
import io.jooby.json.JacksonModule;
+import io.jooby.json.JacksonModule;
{
install(new JacksonModule(new XmlMapper()));
-}
+}
import io.jooby.json.JacksonModule;
+import io.jooby.json.JacksonModule;
{
install(new JacksonModule(new ObjectMapper()));
install(new JacksonModule(new XmlMapper()));
-}
+}
import io.jooby.json.JacksonModule;
+import io.jooby.json.JacksonModule;
{
install(new JacksonModule().module(MyModule.class);
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jasypt</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
jasypt.password = password (1)
+jasypt.password = password (1)
-enc.property = "uTSqb9grs1+vUv3iN8lItC0kl65lMG+8" (2)
+enc.property = "uTSqb9grs1+vUv3iN8lItC0kl65lMG+8" (2)
import io.jooby.jasypt.JasyptModule;
+import io.jooby.jasypt.JasyptModule;
{
install(new JasyptModule()); (3)
@@ -634,9 +634,9 @@ (4)
System.out.println(property);
-}
+}
import io.jooby.jasypt.JasyptModule;
+import io.jooby.jasypt.JasyptModule;
{
install(new JasyptModule());
PBEStringEncryptor encryptor = require(PBEStringEncryptor.class);
-}
+}
jasypt.password = mypassword
-jasypt.password = ${?JASYPT_PASSWORD}
+jasypt.password = mypassword
+jasypt.password = ${?JASYPT_PASSWORD}
{
+{
install(new JasyptModule(config -> {
return new String(Files.path(Paths.get("mypassword"), UTF-8));
}));
-}
+}
jasypt.password = mypassword
+jasypt.password = mypassword
jasypt.algorithm = PBEWithMD5AndDES
jasypt.keyObtentionIterations = 1000
jasypt.poolSize = 2
jasypt.ivGeneratorClassName = classname
jasypt.saltGeneratorClassName = org.jasypt.salt.RandomSaltGenerator
-jasypt.providerName = SunJCE
+jasypt.providerName = SunJCE
<!-- DataSource via HikariCP-->
+<!-- DataSource via HikariCP-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-hikari</artifactId>
- <version>3.0.6</version>
+ <version>3.0.7</version>
</dependency>
<!-- Jdbi Module-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jdbi</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<dependency>
- <groupId>com.mysql</groupId>
- <artifactId>mysql-connector-j</artifactId>
- <version></version>
-</dependency>
+<dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>${mysql-connector-java.version}</version>
+</dependency>
db.url = "jdbc:mysql://localhost/mydb"
+db.url = "jdbc:mysql://localhost/mydb"
db.user = myuser
-db.password = mypass
+db.password = mypass
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
import io.jooby.jdbi.JdbiModule;
{
@@ -671,9 +671,9 @@
+}
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
import io.jooby.jdbi.JdbiModule;
import io.jooby.jdbi.TransactionalRequest;
@@ -749,9 +749,9 @@
+}
import io.jooby.annotation.Transactional;
+import io.jooby.annotation.Transactional;
@Transactional(false)
@GET("/")
public void get(Context ctx) {
// no automatic transaction management here
-}
+}
import io.jooby.ebean.TransactionalRequest;
+import io.jooby.ebean.TransactionalRequest;
{
...
use(new TransactionalRequest().enabledByDefault(false));
...
-}
+}
import io.jooby.annotation.Transactional;
+import io.jooby.annotation.Transactional;
@Inject
private Handle handle;
@@ -847,9 +847,9 @@
+}
{
+{
get("/", ctx -> {
...
}).attribute(Transactional.ATTRIBUTE, false);
-}
+}
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
import io.jooby.jdbi.JdbiModule;
import io.jooby.jdbi.TransactionalRequest;
@@ -911,9 +911,9 @@
+}
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
import io.jooby.jdbi.JdbiModule;
import io.jooby.jdbi.TransactionalRequest;
@@ -954,9 +954,9 @@ <
Jdbi jdbi = Jdbi.create(dataSource);
return jdbi;
});
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jstachio</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
@JStache(path="index.mustache") (1)
-public record IndexPage(String message){}
+@JStache(path="index.mustache") (1)
+public record IndexPage(String message){}
<p>Hello {{message}}!</p>
+<p>Hello {{message}}!</p>
import io.jooby.jstachio.JStachioModule;
+import io.jooby.jstachio.JStachioModule;
{
install(new JStachioModule()); (1)
@@ -686,9 +686,9 @@ (2)
});
-}
+}
import io.jooby.jstachio.JStachioModule;
+import io.jooby.jstachio.JStachioModule;
{
install(new JStachioModule().bufferSize(1024));
-}
+}
<dependencies>
+<dependencies>
<dependency>
<groupId>io.jstach</groupId>
<artifactId>jstachio-jmustache</artifactId>
- <version>1.3.2</version>
+ <version>1.3.4</version>
<scope>runtime</scope>
</dependency>
-<dependencies>
+<dependencies>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jte</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<plugin>
+<plugin>
<groupId>gg.jte</groupId>
<artifactId>jte-maven-plugin</artifactId>
<version>${jte.version}</version>
@@ -631,9 +631,9 @@
+</plugin>
@param String name
+@param String name
-<p>Hello ${name}!</p>
+<p>Hello ${name}!</p>
import io.jooby.jte.JteModule;
+import io.jooby.jte.JteModule;
{
install(new JteModule(Paths.of("src", "main", "jte"))); (1)
@@ -685,9 +685,9 @@ (2)
});
-}
+}
<plugin>
+<plugin>
<groupId>gg.jte</groupId>
<artifactId>jte-maven-plugin</artifactId>
<version>${jte.version}</version>
@@ -754,9 +754,9 @@
+</plugin>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jwt</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-kafka</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
kafka.producer.bootstrap.servers = "localhost:9092"
+kafka.producer.bootstrap.servers = "localhost:9092"
kafka.producer.key.serializer = "org.apache.kafka.common.serialization.StringSerializer"
kafka.producer.value.serializer = "org.apache.kafka.common.serialization.StringSerializer"
kafka.consumer.bootstrap.servers = "localhost:9092"
kafka.consumer.key.deserializer = "org.apache.kafka.common.serialization.StringDeserializer"
-kafka.consumer.value.deserializer = "org.apache.kafka.common.serialization.StringDeserializer"
+kafka.consumer.value.deserializer = "org.apache.kafka.common.serialization.StringDeserializer"
import io.jooby.kafka.KafkaModule;
+import io.jooby.kafka.KafkaModule;
{
install(new KafkaModule()); (1)
@@ -638,9 +638,9 @@
+}
<!-- Metrics Module-->
+<!-- Metrics Module-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-metrics</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
{
+{
install(new MetricsModule()
.metric("memory", new MemoryUsageGaugeSet())
.metric("threads", new ThreadStatesGaugeSet())
.metric("gc", new GarbageCollectorMetricSet())
.metric("fs", new FileDescriptorRatioGauge()));
-}
+}
{
+{
install(new MetricsModule()
.healthCheck("deadlock", new ThreadDeadlockHealthCheck());
-}
+}
{
+{
use(new Metricsuse());
// inspected route
get("/", context -> "Hello metrics!");
-}
+}
{
+{
install(new MetricsModule()
.threadDump();
-}
+}
{
+{
install(new MetricsModule()
.reporter(registry -> {
ConsoleReporter reporter = ConsoleReporter.forRegistry(registry)
@@ -767,9 +767,9 @@
+}
{
+{
MetricRegistry metricRegistry = new MetricRegistry();
HealthCheckRegistry healthCheckRegistry = new HealthCheckRegistry();
@@ -805,9 +805,9 @@
+}
{
+{
install(new MetricsModule("/diag")
.threadDump();
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-node</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
{
+{
"name": "myapp",
"version": "1.0.0",
"scripts": {
"build": "echo \"Default task\"" (1)
}
-}
+}
import io.jooby.node.NpmModule;
+import io.jooby.node.NpmModule;
{
install(new NpmModule("v12.16.1")); (2)
-}
+}
import io.jooby.node.NpmModule;
+import io.jooby.node.NpmModule;
{
install(new NpmModule("v12.16.1")
.execute("run", "local") (1)
);
-}
+}
<properties>
+<properties>
<application.class>myapp.App</application.class>
</properties>
...
@@ -629,7 +629,7 @@ <
<plugin>
<groupId>io.jooby</groupId>
<artifactId>jooby-maven-plugin</artifactId>
- <version>3.0.6</version>
+ <version>3.0.7</version>
<executions>
<execution>
<goals>
@@ -638,12 +638,12 @@ <
</execution>
</executions>
</plugin>
-</plugins>
+</plugins>
<dependency>
+<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version></version>
-</dependency>
+</dependency>
@OpenAPIDefinition(
+@OpenAPIDefinition(
info = @Info(
title = "Title",
description = "description",
@@ -966,9 +966,9 @@
+}
@Tag(name = "Pets", description = "Pet operations")
+@Tag(name = "Pets", description = "Pet operations")
class App extends Jooby {
{
// All routes now have the default tag: `Pets`
}
-}
+}
@Tag(name = "Pets", description = "Pet operations")
+@Tag(name = "Pets", description = "Pet operations")
@Path("/pets")
class Pets {
// All web method now have the default tag: `Pets`
-}
+}
@Tag(name = "Pets", description = "Pet operations")
+@Tag(name = "Pets", description = "Pet operations")
public List<Pet> list(Context ctx) {
...
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-swagger-ui</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-redoc</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-pac4j</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.pac4j.Pac4jModule;
+import io.jooby.pac4j.Pac4jModule;
{
install(new Pac4jModule()); (1)
@@ -629,9 +629,9 @@ (2)
return "Hello " + user.getId();
});
-}
+}
<dependency>
+<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-oidc</artifactId>
<version>5.7.0</version>
-</dependency>
+</dependency>
oidc.clientId = 167480702619-8e1lo80dnu8bpk3k0lvvj27noin97vu9.apps.googleusercontent.com
-oidc.secret = MhMme_Ik6IH2JMnAT6MFIfee
+oidc.clientId = 167480702619-8e1lo80dnu8bpk3k0lvvj27noin97vu9.apps.googleusercontent.com
+oidc.secret = MhMme_Ik6IH2JMnAT6MFIfee
import io.jooby.pac4j.Pac4jModule;
+import io.jooby.pac4j.Pac4jModule;
{
install(new Pac4jModule()
@@ -720,9 +720,9 @@
+}
<dependency>
+<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-oauth</artifactId>
<version>5.7.0</version>
-</dependency>
+</dependency>
<dependency>
+<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-jwt</artifactId>
<version>5.7.0</version>
-</dependency>
+</dependency>
jwt.salt = CoxUiYwQOSFDReZYdjigBA
+jwt.salt = CoxUiYwQOSFDReZYdjigBA
import io.jooby.pac4j.Pac4jModule;
+import io.jooby.pac4j.Pac4jModule;
{
install(new Pac4jModule()
@@ -866,9 +866,9 @@
+}
import io.jooby.pac4j.Pac4jModule;
+import io.jooby.pac4j.Pac4jModule;
{
install(new Pac4jModule()
@@ -907,9 +907,9 @@ <
return ...;
})
);
-}
+}
{
+{
install(
new Pac4jModule()
.client("/api/*", new MyTestAuthorizer(), conf -> {...});
);
-}
+}
{
+{
install(
new Pac4jModule()
.client("/api/*", MyTestAuthorizer.class, conf -> {...});
);
-}
+}
import io.jooby.pac4j.Pac4jModule;
+import io.jooby.pac4j.Pac4jModule;
import org.pac4j.core.config.Config;
{
@@ -996,9 +996,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-pebble</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<p> Hello {{name}}! </p>
+<p> Hello {{name}}! </p>
import io.jooby.pebble.PebbleModule;
+import io.jooby.pebble.PebbleModule;
{
install(new PebbleModule());
@@ -630,9 +630,9 @@
+}
import io.jooby.pebble.PebbleModule;
+import io.jooby.pebble.PebbleModule;
{
// Apply custom configuration via builder
@@ -684,9 +684,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-quartz</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.quartz.QuartzModule;
+import io.jooby.quartz.QuartzModule;
{
install(new QuartzModule(SampleJob.class));
-}
+}
import io.quartz.Scheduled;
+import io.quartz.Scheduled;
import org.quartz.Job;
@@ -652,9 +652,9 @@
+}
import io.quartz.Scheduled;
+import io.quartz.Scheduled;
public class SampleJob {
@@ -699,9 +699,9 @@
+}
import io.quartz.Scheduled;
+import io.quartz.Scheduled;
public class SampleJob {
@@ -742,9 +742,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-hikari</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.hikari.HikariModule;
+import io.jooby.hikari.HikariModule;
import io.jooby.quartz.QuartzModule;
{
install(new HikariModule());
install(new QuartzModule(SampleJob.class));
-}
+}
db.url = "jdbc:mysql://localhost/mydb"
+db.url = "jdbc:mysql://localhost/mydb"
db.user = "myuser"
db.password = "mypassword"
-org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
+org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
# Set number of threads to use, default is to use the number of available processor
-org.quartz.threadPool.threadCount = 2
+# Set number of threads to use, default is to use the number of available processor
+org.quartz.threadPool.threadCount = 2
{
+{
Scheduler scheduler = QuartzModule.newScheduler(this);
// configure scheduler as you need it
install(new QuartzModule(scheduler, SampleJob.class));
-}
+}
org.quartz.jobs.SampleJob.execute.enabled = false
+org.quartz.jobs.SampleJob.execute.enabled = false
import io.jooby.quartz.QuartzApp
+import io.jooby.quartz.QuartzApp
import io.jooby.quartz.QuartzModule;
{
install(new QuartzModule(SampleJob.class));
use("/scheduler", new QuartzApp());
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-redis</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
redis = "redis://localhost:6379"
+redis = "redis://localhost:6379"
import io.jooby.redis.RedisModule;
+import io.jooby.redis.RedisModule;
import io.lettuce.core.api.StatefulRedisConnection;
{
@@ -631,9 +631,9 @@ (2)
// work with redis
});
-}
+}
import io.jooby.redis.RedisModule;
+import io.jooby.redis.RedisModule;
import io.lettuce.core.api.StatefulRedisConnection;
{
@@ -710,9 +710,9 @@
+}
foo = "redis://server1:6379"
+foo = "redis://server1:6379"
-bar = "redis://server2:6379"
+bar = "redis://server2:6379"
import io.jooby.redis.RedisModule;
+import io.jooby.redis.RedisModule;
import io.jooby.redis.RedisSessionStore;
import io.lettuce.core.RedisClient;
@@ -762,9 +762,9 @@ (3)
// HTTP session is backed by Redis
});
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-rocker</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<plugin>
+<plugin>
<groupId>com.fizzed</groupId>
<artifactId>rocker-maven-plugin</artifactId>
- <version>1.3.0</version>
+ <version>1.4.0</version>
<configuration>
<templateDirectory>src/rocker</templateDirectory>
</configuration>
@@ -627,10 +627,10 @@
+</plugin>
@args (String message)
+@args (String message)
-<p>Hello @message!</p>
+<p>Hello @message!</p>
import io.jooby.rocker.RockerModule;
+import io.jooby.rocker.RockerModule;
{
install(new RockerModule()); (1)
@@ -680,9 +680,9 @@ (2)
});
-}
+}
import io.jooby.rocker.RockerModule;
+import io.jooby.rocker.RockerModule;
{
install(new RockerModule().bufferSize(1024));
-}
+}
import io.jooby.rocker.RockerModule;
+import io.jooby.rocker.RockerModule;
{
install(new RockerModule().reuseBuffer(true));
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-thymeleaf</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
<!DOCTYPE html>
+<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>
<p>
Hello <span th:text="${name}">World</span>
</p>
</body>
-</html>
+</html>
import io.jooby.thymeleaf.ThymeleafModule;
+import io.jooby.thymeleaf.ThymeleafModule;
{
install(new ThymeleafModule());
@@ -637,9 +637,9 @@
+}
import io.jooby.thymeleaf.ThymeleafModule;
+import io.jooby.thymeleaf.ThymeleafModule;
{
TemplateEngine templateEngine = new TemplateEngine();
// configure as need it
install(new ThymeleafModule(templateEngine));
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-whoops</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.whoops.WhoopsModule;
+import io.jooby.whoops.WhoopsModule;
{
install(new WhoopsModule()); (1)
@@ -622,9 +622,9 @@ (2)
});
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-yasson</artifactId>
- <version>3.0.6</version>
-</dependency>
+ <version>3.0.7</version>
+</dependency>
import io.jooby.json.YassonModule;
+import io.jooby.json.YassonModule;
{
install(new YassonModule()); (1)
@@ -624,9 +624,9 @@ (3)
...
});
-}
+}
import io.jooby.json.YassonModule;
+import io.jooby.json.YassonModule;
{
install(new YassonModule());
@@ -677,15 +677,15 @@
+}
import io.jooby.json.YassonModule;
+import io.jooby.json.YassonModule;
{
Jsonb jsonb = JsonbBuilder.create();
install(new YassonModule(jsonb));
-}
+}
<build>
+<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
- <version>2.36</version>
+ <version>2.39</version>
<extensions>true</extensions>
<configuration>
<tiles>
- <tile>io.jooby:jooby-stork:3.0.6</tile>
+ <tile>io.jooby:jooby-stork:3.0.7</tile>
</tiles>
</configuration>
</plugin>
</plugins>
-</build>
+</build>
<build>
+ <build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
@@ -631,20 +631,20 @@
+ </build>
dependencies {
- annotationProcessor "io.jooby:jooby-apt:3.0.6"
-}
+dependencies {
+ annotationProcessor "io.jooby:jooby-apt:3.0.7"
+}
<build>
+ <build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
@@ -847,14 +847,14 @@
+ </build>
tasks.withType(JavaCompile) {
+tasks.withType(JavaCompile) {
options.compilerArgs << '-parameters'
options.debug = true
-}
+}