jooby set -w ~/Source
+jooby set -w ~/Source
diff --git a/index.html b/index.html index 293e1df..a38fda9 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - +
Looking for a previous version?
@@ -1046,7 +1046,7 @@import io.jooby.Jooby;
+import io.jooby.Jooby;
public class App extends Jooby {
@@ -1057,9 +1057,9 @@
+}
import io.jooby.annotation.*;
+import io.jooby.annotation.*;
public class MyController {
@@ -1142,9 +1142,9 @@
+}
Download jooby-cli.zip
+Download jooby-cli.zip
Unzip jooby-cli.zip
in your user home directory (or any other directory you prefer)
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.5.0</version>
-</dependency>
+ <version>3.5.1</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");
@@ -1539,9 +1539,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();
@@ -1581,9 +1581,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)
@@ -1820,9 +1820,9 @@ (3)
return path;
});
-}
+}
{
+{
get("/user/{id}", ctx -> ctx.path("id").value()); (1)
get("/user/me", ctx -> "my profile"); (2)
@@ -1907,9 +1907,9 @@ (3)
get("/users", ctx -> "new users"); (4)
-}
+}
interface Filter {
+interface Filter {
Handler apply(Handler next);
-}
+}
{
+{
use(next -> ctx -> {
long start = System.currentTimeMillis(); (1)
@@ -1984,9 +1984,9 @@ <
get("/", ctx -> {
return "filter";
});
-}
+}
interface Before {
+interface Before {
void apply(Context ctx);
-}
+}
{
+{
before(ctx -> {
ctx.setResponseHeader("Server", "Jooby");
});
@@ -2070,9 +2070,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)
@@ -2163,9 +2163,9 @@
+}
{
+{
after((ctx, result, failure) -> {
if (ctx.isResponseStarted()) {
// Don't modify response
@@ -2210,9 +2210,9 @@
+}
{
+{
after((ctx, result, failure) -> {
if (failure == null) {
db.commit(); (1)
@@ -2254,9 +2254,9 @@ (2)
}
});
-}
+}
{
+{
after((ctx, result, failure) -> {
if (failure instanceOf MyBusinessException) {
ctx.send("Recovering from something"); (1)
}
});
-}
+}
{
+{
after((ctx, result, failure) -> {
...
throw new AnotherException();
@@ -2324,9 +2324,9 @@ (1)
Throwable anotherException = failure.getSuppressed()[0]; (2)
});
-}
+}
{
+{
use(next -> ctx -> {
long start = System.currentTimeInMillis();
ctx.onComplete(context -> { (1)
@@ -2379,9 +2379,9 @@
+}
{
+{
// Increment +1
use(next -> ctx -> {
Number n = (Number) next.apply(ctx);
@@ -2434,9 +2434,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);
@@ -2564,9 +2564,9 @@ <
});
get("/2", ctx -> 2); (2)
-}
+}
{
+{
// Increment +1
use(next -> ctx -> {
Number n = (Number) next.apply(ctx);
@@ -2632,9 +2632,9 @@ (3)
-}
+}
{
+{
routes(() -> {
get("/", ctx -> "Hello");
});
-}
+}
public class Foo extends Jooby {
+public class Foo extends Jooby {
{
get("/foo", Context::getRequestPath);
}
@@ -2802,9 +2802,9 @@ (3)
}
-}
+}
public class Foo extends Jooby {
+public class Foo extends Jooby {
{
get("/foo", Context::getRequestPath);
}
@@ -2855,9 +2855,9 @@ (1)
}
-}
+}
public class Foo extends Jooby {
+public class Foo extends Jooby {
{
get("/foo", ctx -> ...);
}
@@ -2911,9 +2911,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");
}
@@ -3005,9 +3005,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;
...
{
@@ -3076,9 +3076,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;
...
{
@@ -3154,9 +3154,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)
@@ -3431,9 +3431,9 @@ (4)
get("/{id:[0-9]+}", ctx -> ctx.path("id)) (5)
-}
+}
{
+{
get("/{name}", ctx -> {
String pathString = ctx.getRequestPath(); (1)
@@ -3486,9 +3486,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().put("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;
});
@@ -4072,9 +4072,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)
@@ -4171,9 +4171,9 @@ (4)
...
});
-}
+}
{
+{
get("/search", ctx -> {
String q = ctx.query("q").value("*:*"); (1)
return q;
@@ -4290,9 +4290,9 @@ (2)
return q;
});
-}
+}
{
+{
get("/", ctx -> {
Value user = ctx.query("user"); (1)
String name = user.get("name").value(); (2)
@@ -4460,9 +4460,9 @@ (4)
...
}}
-}
+}
class Member {
+class Member {
public final String firstname;
public final String lastName;
@@ -4564,11 +4564,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;
@@ -4718,9 +4718,9 @@ PO
public Member(@Named("first-name") String firstname, @Named("last-name") String lastname) {
....
}
-}
+}
{
+{
post("/string", ctx -> {
String body = ctx.body().value(); (1)
...
@@ -4753,9 +4753,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)
@@ -4826,9 +4826,9 @@ (5)
});
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jackson</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
{
+{
get("/", ctx -> {
ctx.setResponseCode(200); (1)
@@ -4916,9 +4916,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)
@@ -4988,9 +4988,9 @@ (6)
});
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jackson</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</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 {
@@ -5147,9 +5147,9 @@
+}
public class App extends Jooby {
+public class App extends Jooby {
{
mvc(new MyController_());
}
@@ -5216,15 +5216,15 @@
+}
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 Controller {
+public class Controller {
@GET("/{foo}")
public String bind(@BindParam MyBean bean) {
return "with custom mapping: " + bean;
}
-}
+}
public record MyBean(String value) {
+public record MyBean(String value) {
public static MyBean of(Context ctx) {
// build MyBean from HTTP request
}
-}
+}
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());
}
@@ -5828,15 +5828,15 @@ (1)
}
-}
+}
public class App extends Jooby {
+public class App extends Jooby {
{
dispatch(() -> {
mvc(new MyBlockingController()); (1)
@@ -5864,9 +5864,9 @@
+}
public class MyController {
+public class MyController {
@GET("/nonblocking")
public String nonblocking() { (1)
return "I'm nonblocking";
@@ -5904,9 +5904,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")
@@ -6013,9 +6013,9 @@
+}
<plugin>
+ <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
@@ -6141,9 +6141,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)
-}
+}
{
+{
assets("/static/*", Paths.get("www"))
.setLastModified(false)
.setEtag(false);
-}
+}
{
+{
assets("/static/*", Paths.get("www"))
.setMaxAge(Duration.ofDays(365))
-}
+}
{
+{
assets("/static/*", Paths.get("www"))
.cacheControl(path -> {
if (path.endsWith("dont-cache-me.html")) {
@@ -6419,9 +6419,9 @@
+}
{
+{
assets("/static/*", Paths.get("www"))
.notFound(ctx -> {
throw new MyAssetException();
@@ -6452,9 +6452,9 @@
+}
{
+{
install(new MyTemplateEngineModule()); (1)
get("/", ctx -> {
MyModel model = ...; (2)
return new ModelAndView("index.html", model); (3)
});
-}
+}
{
+{
install(new MyTemplateEngineModule());
get("/", ctx -> {
@@ -6528,9 +6528,9 @@ (1)
});
-}
+}
{
+{
install(new HandlebarsModule()); (1)
install(new FreemarkerModule()); (2)
@@ -6600,9 +6600,9 @@ (4)
});
-}
+}
{
+{
get("/", ctx -> {
Session session = ctx.session(); (1)
@@ -6726,9 +6726,9 @@ (3)
});
-}
+}
{
+{
setSessionStore(SessionStore.memory(new Cookie("SESSION"))); (1)
get("/", ctx -> {
@@ -6772,9 +6772,9 @@
+}
{
+{
setSessionStore(SessionStore.memory(SessionToken.header("TOKEN"))); (1)
get("/", ctx -> {
@@ -6812,9 +6812,9 @@
+}
{
+{
setSessionStore(SessionStore.memory(SessionToken.comibe(SessionToken.cookie("SESSION"), SessionToken.header("TOKEN")))); (1)
get("/", ctx -> {
@@ -6852,9 +6852,9 @@
+}
{
+{
String secret = "super secret key"; (1)
setSessionStore(SessionStore.signed(secret)); (2)
@@ -6910,9 +6910,9 @@
+}
{
+{
String secret = "super secret key"; (1)
setSessionStore(SessionStore.signed(secret, SessionToken.header("TOKEN"))); (2)
@@ -6958,9 +6958,9 @@
+}
{
+{
ws("/ws", (ctx, configurer) -> { (1)
configurer.onConnect(ws -> {
ws.send("Connected"); (2)
@@ -7025,9 +7025,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)
@@ -7130,9 +7130,9 @@ (3)
})
});
-}
+}
import io.jooby.jackson.JacksonModule;
+import io.jooby.jackson.JacksonModule;
{
install(new JackonModule()); (1)
@@ -7180,9 +7180,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 {
@@ -7421,16 +7421,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 {
@@ -7473,9 +7473,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 {
@@ -7534,9 +7534,9 @@
+}
import static io.jooby.ExecutionMode.WORKER;
+import static io.jooby.ExecutionMode.WORKER;
import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -7586,9 +7586,9 @@
+}
import static io.jooby.ExecutionMode.WORKER;
+import static io.jooby.ExecutionMode.WORKER;
import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -7628,9 +7628,9 @@
+}
import static io.jooby.Jooby.runApp;
+import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -7717,9 +7717,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)
@@ -7939,9 +7939,9 @@ (3)
});
-}
+}
{
+{
get("/chunk", ctx -> {
return ctx.responseWriter(writer -> { (1)
writer.write("chunk1"); (2)
@@ -7985,9 +7985,9 @@
+}
{
+{
get("/download-file", ctx -> {
Path source = Paths.get("logo.png");
return new AttachedFile(source); (1)
@@ -8020,9 +8020,9 @@ (2)
});
-}
+}
FileDownload.Builder produceDownload(Context ctx) {
+FileDownload.Builder produceDownload(Context ctx) {
return FileDownload.build(...);
}
@@ -8063,9 +8063,9 @@
+}
{
+{
mode(EVENT_LOOP); (1)
use(ReactiveSupport.concurrent()); (2)
@@ -8108,9 +8108,9 @@ <
... (4)
});
})
-}
+}
{
+{
mode(WORKER); (1)
use(ReactiveSupport.concurrent()); (2)
@@ -8164,9 +8164,9 @@ <
... (4)
});
})
-}
+}
{
+{
mode(DEFAULT); (1)
use(ReactiveSupport.concurrent()); (2)
@@ -8220,9 +8220,9 @@ <
... (4)
});
})
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-mutiny</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
import io.jooby.mutiny;
+import io.jooby.mutiny;
import io.smallrye.mutiny.Uni;
{
@@ -8345,9 +8345,9 @@ Uni
.completionStage(supplyAsync(() -> "Uni"))
.map(it -> "Hello " + it);
})
-}
+}
import io.jooby.mutiny;
+import io.jooby.mutiny;
import io.smallrye.mutiny.Multi;
{
@@ -8380,9 +8380,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-rxjava3</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
import io.jooby.rxjava3.Reactivex;
+import io.jooby.rxjava3.Reactivex;
{
use(Reactivex.rx());
@@ -8460,9 +8460,9 @@
+}
import io.jooby.rxjava3.Reactivex;
+import io.jooby.rxjava3.Reactivex;
{
use(Reactivex.rx());
@@ -8491,9 +8491,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-reactor</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
import io.jooby.Reactor;
+import io.jooby.Reactor;
{
use(Reactor.reactor());
@@ -8572,9 +8572,9 @@ Mo
.fromCallable(() -> "Mono")
.map(it -> "Hello " + it);
})
-}
+}
import io.jooby.Reactor;
+import io.jooby.Reactor;
{
use(Reactor.reactor())
@@ -8603,9 +8603,9 @@ Fl
return Flux.range(1, 10)
.map(it -> it + ", ");
})
-}
+}
{
+{
coroutine {
get("/") {
delay(100) (1)
"Hello Coroutines!" (2)
}
}
-}
+}
{
+{
coroutine {
get("/") {
ctx.doSomething() (1)
@@ -8688,7 +8688,7 @@ (2)
return "Hello Coroutines!" (3)
-}
+}
{
+{
worker(Executors.newCachedThreadPool())
coroutine {
@@ -8728,7 +8728,7 @@ (3)
}
}
-}
+}
{
+{
coroutine(CoroutineStart.UNDISPATCHED) {
get("/") {
val n = 5 * 5 (1)
@@ -8765,7 +8765,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;
{
@@ -9038,9 +9038,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
});
-}
+}
problem.details.enabled = true
+problem.details.enabled = true
problem.details {
+problem.details {
enabled = true
log4xxErrors = true (1)
muteCodes = [401, 403] (2)
muteTypes = ["com.example.MyMutedException"] (3)
-}
+}
import io.jooby.problem.HttpProblem;
+import io.jooby.problem.HttpProblem;
get("/users/{userId}", ctx -> {
var userId = ctx.path("userId").value();
@@ -9273,9 +9273,9 @@
+});
{
+{
"timestamp": "2024-10-05T14:10:41.648933100Z",
"type": "about:blank",
"title": "User Not Found",
"status": 404,
"detail": "User with ID 123 was not found in the system.",
"instance": null
-}
+}
throw HttpProblem.builder()
+throw HttpProblem.builder()
.type(URI.create("http://example.com/invalid-params"))
.title("Invalid input parameters")
.status(StatusCode.UNPROCESSABLE_ENTITY)
.detail("'Name' may not be empty")
.instance(URI.create("http://example.com/invalid-params/3325"))
- .build();
+ .build();
throw HttpProblem.builder()
+throw HttpProblem.builder()
.title("Order not found")
.status(StatusCode.NOT_FOUND)
.detail("Order with ID $orderId could not be processed because it is missing or invalid.")
.param("reason", "Order ID format incorrect or order does not exist.")
.param("suggestion", "Please check the order ID and try again")
.param("supportReference", "/support")
- .build();
+ .build();
throw HttpProblem.builder()
+throw HttpProblem.builder()
.title("Invalid input parameters")
.status(StatusCode.UNPROCESSABLE_ENTITY)
.header("my-string-header", "string")
.header("my-int-header", 100)
- .build();
+ .build();
throw HttpProblem.builder()
+throw HttpProblem.builder()
...
.error(new HttpProblem.Error("First name cannot be blank", "/firstName"))
.error(new HttpProblem.Error("Last name is required", "/lastName"))
- .build();
+ .build();
public class OutOfStockProblem extends HttpProblem {
+public class OutOfStockProblem extends HttpProblem {
private static final URI TYPE = URI.create("https://example.org/out-of-stock");
@@ -9473,7 +9473,7 @@
+}
{
+{
...
error(MyCustomException.class, (ctx, cause, code) -> {
MyCustomException ex = (MyCustomException) cause;
@@ -9493,7 +9493,7 @@ (2)
});
-}
+}
import io.jooby.Jooby;
+import io.jooby.Jooby;
import io.jooby.AccessLogHandler;
...
{
@@ -9553,9 +9553,9 @@
+}
import io.jooby.Jooby;
+import io.jooby.Jooby;
import io.jooby.CorsHandler;
...
{
@@ -9666,9 +9666,9 @@
+}
import io.jooby.Jooby;
+import io.jooby.Jooby;
import io.jooby.CorsHandler;
...
{
@@ -9728,9 +9728,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;
...
{
@@ -9893,15 +9893,15 @@ (1)
// other routes go here
-}
+}
import io.jooby.Jooby;
+import io.jooby.Jooby;
import io.jooby.HeadHandler;
...
{
@@ -9961,9 +9961,9 @@
+}
<dependency>
+<dependency>
<groupId>com.github.vladimir-bukhtoyarov</groupId>
<artifactId>bucket4j-core</artifactId>
<version>8.0.1</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;
...
{
@@ -10277,9 +10277,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>1.5.12</version>
-</dependency>
+</dependency>
<dependency>
+<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.24.1</version>
@@ -10779,17 +10779,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>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
public class App extends Jooby {
+public class App extends Jooby {
{
get("/", ctx -> "Easy unit testing!");
}
-}
+}
import io.jooby.test.MockRouter;
+import io.jooby.test.MockRouter;
public class TestApp {
@@ -11014,9 +11014,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 {
@@ -11167,9 +11167,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-test</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</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 {
@@ -11284,9 +11284,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 {
@@ -11443,9 +11443,9 @@ (2)
return new App("Argument"); (3)
}
-}
+}
<plugins>
+<plugins>
...
<plugin>
<groupId>io.jooby</groupId>
<artifactId>jooby-maven-plugin</artifactId>
- <version>3.5.0</version>
+ <version>3.5.1</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.5.0</version>
+ <version>3.5.1</version>
<configuration>
<mainClass>${application.class}</mainClass> (1)
<restartExtensions>conf,properties,class</restartExtensions> (2)
@@ -11611,17 +11611,17 @@ <
</configuration>
</plugin>
...
-</plugins>
+</plugins>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jetty</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-netty</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-undertow</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
import io.jooby.netty.NettyServer;
+import io.jooby.netty.NettyServer;
{
install(new NettyServer());
-}
+}
{
+{
setServerOptions(new ServerOptions()
.setBufferSize(16384)
.setCompressionLevel(6)
@@ -12036,9 +12036,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)
@@ -12381,16 +12381,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.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
{
+{
setServerOptions(new ServerOptions()
.setHttp2(true)
.setSecurePort(8433)
@@ -12554,9 +12554,9 @@
+}
import io.jooby.Extension;
+import io.jooby.Extension;
public class MyExtension implements Extension {
@@ -12632,9 +12632,9 @@ (4)
}
-}
+}
public class App extends Jooby {
+public class App extends Jooby {
{
install(new MyExtension()); (1)
@@ -12684,9 +12684,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-avaje-inject</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<build>
+<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -12774,15 +12774,15 @@
+</build>
public class App extends Jooby {
+public class App extends Jooby {
{
install(AvajeInjectModule.of()); (1)
@@ -12820,9 +12820,9 @@
+}
currency = USD
+currency = USD
public class App extends Jooby {
+public class App extends Jooby {
{
install(AvajeInjectModule.of()); (1)
@@ -12898,15 +12898,15 @@
+}
<dependency>
+<dependency>
<groupId>com.google.dagger</groupId>
<artifactId>dagger</artifactId>
<version>2.20</version>
-</dependency>
+</dependency>
<build>
+<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -12971,15 +12971,15 @@
+</build>
import static io.jooby.Jooby.runApp;
+import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -13007,9 +13007,9 @@
+}
import static io.jooby.Jooby.runApp;
+import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -13075,9 +13075,9 @@
+}
import static io.jooby.Jooby.runApp;
+import static io.jooby.Jooby.runApp;
public class App extends Jooby {
@@ -13125,9 +13125,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-guice</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
import io.jooby.guice.GuiceModule;
+import io.jooby.guice.GuiceModule;
import io.jooby.kt.runApp;
public class App extends Jooby {
@@ -13195,9 +13195,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 {
@@ -13280,9 +13280,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-kotlin</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
{
+{
use("*", (req, rsp, chain) -> {
System.out.println("first");
// Moves execution to next handler: second
@@ -14105,7 +14105,7 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-kotlin</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-avaje-inject</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<build>
+<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -623,15 +623,15 @@
+</build>
public class App extends Jooby {
+public class App extends Jooby {
{
install(AvajeInjectModule.of()); (1)
@@ -669,9 +669,9 @@
+}
currency = USD
+currency = USD
public class App extends Jooby {
+public class App extends Jooby {
{
install(AvajeInjectModule.of()); (1)
@@ -747,15 +747,15 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-avaje-jsonb</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</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-avaje-validator</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<build>
+<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -635,15 +635,15 @@ <
</configuration>
</plugin>
</plugins>
-</build>
+</build>
import io.jooby.avaje.validator.AvajeValidatorModule;
+import io.jooby.avaje.validator.AvajeValidatorModule;
{
install(new AvajeValidatorModule());
-}
+}
import io.jooby.annotation.*;
+import io.jooby.annotation.*;
import jakarta.validation.Valid;
@Path("/mvc")
@@ -712,9 +712,9 @@ <
public void validateMap(@Valid Map<String, Bean> beans) { (4)
...
}
-}
+}
import io.jooby.validation.BeanValidator;
+import io.jooby.validation.BeanValidator;
{
use(BeanValidator.validate());
@@ -777,9 +777,9 @@ <
Bean bean = ctx.body(Bean.class);
...
});
-}
+}
{
+{
install(new AvajeJsonbModule());
install(new AvajeValidatorModule()
.statusCode(StatusCode.BAD_REQUEST)
.validationTitle("Incorrect input data")
);
-}
+}
{
+{
install(new AvajeJsonbModule());
install(new AvajeValidatorModule().disableViolationHandler());
error(ConstraintViolationException.class, new MyConstraintViolationHandler());
-}
+}
import io.jooby.avaje.validator.AvajeValidatorModule;
+import io.jooby.avaje.validator.AvajeValidatorModule;
{
install(AvajeInjectModule.of()); (1)
install(new AvajeValidatorModule());
-}
+}
import io.avaje.validation.Validator;
+import io.avaje.validation.Validator;
import jakarta.inject.Inject;
@Path("/mvc")
@@ -953,7 +953,7 @@
Set<ConstraintViolation<Bean>> violations = validator.validate(bean);
...
}
-}
+}
validation.fail_fast = true
+validation.fail_fast = true
import io.jooby.avaje.validator.AvajeValidatorModule;
+import io.jooby.avaje.validator.AvajeValidatorModule;
{
install(new AvajeValidatorModule().doWith(cfg -> {
cfg.failFast(true);
}));
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-awssdk-v1</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version></version>
-</dependency>
+</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-awssdk-v2</artifactId>
<version>1.12.777</version>
-</dependency>
+</dependency>
<dependency>
+<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version></version>
-</dependency>
+</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.awssdkv2.AwsModule;
+import io.jooby.awssdkv2.AwsModule;
{
install(
@@ -650,9 +650,9 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-caffeine</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
+ <version>3.5.1</version>
</dependency>
<!-- Db Scheduler Module-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-db-scheduler</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java.version}</version>
-</dependency>
+</dependency>
import io.jooby.dbscheduler.DbSchedulerModule;
+import io.jooby.dbscheduler.DbSchedulerModule;
{
install(new HikariModule());
install(new DbSchedulerModule(Tasks.recurring(...)));
-}
+}
import io.jooby.dbscheduler.Scheduled;
+import io.jooby.dbscheduler.Scheduled;
public class SampleJob {
@@ -674,9 +674,9 @@
+}
import io.jooby.dbscheduler.BeanTasks;
+import io.jooby.dbscheduler.BeanTasks;
{
install(new HikariModule());
install(new DbSchedulerModule(BeanTasks.recurring(this, SampleJob.class)));
-}
+}
<!-- DataSource via HikariCP-->
+<!-- DataSource via HikariCP-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-hikari</artifactId>
- <version>3.5.0</version>
+ <version>3.5.1</version>
</dependency>
<!-- Ebean Module-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-ebean</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java.version}</version>
-</dependency>
+</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>
@@ -665,9 +665,9 @@
+</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.5.0</version>
+ <version>3.5.1</version>
</dependency>
<!-- Flyway Module-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-flyway</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java.version}</version>
-</dependency>
+</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.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
+ <version>3.5.1</version>
</dependency>
<!-- JSON library-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jackson</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
+ <version>3.5.1</version>
</dependency>
<!-- GraphQL-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-graphql</artifactId>
- <version>3.5.0</version>
+ <version>3.5.1</version>
</dependency>
<!-- GraphIQL-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-graphiql</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
+ <version>3.5.1</version>
</dependency>
<!-- GraphQL-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-graphql</artifactId>
- <version>3.5.0</version>
+ <version>3.5.1</version>
</dependency>
<!-- GraphQL Playground-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-graphiql-playground</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
import io.jooby.gson.GsonModule;
+import io.jooby.gson.GsonModule;
{
install(new GsonModule()); (1)
@@ -624,9 +624,9 @@ (3)
...
});
-}
+}
import io.jooby.gson.GsonModule;
+import io.jooby.gson.GsonModule;
{
install(new GsonModule());
@@ -677,15 +677,15 @@
+}
import io.jooby.gson.GsonModule;
+import io.jooby.gson.GsonModule;
{
Gson gson = new GsonBuilder().create();
install(new GsonModule(gson));
-}
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-guice</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
-</dependency>
+ <version>3.5.1</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 @@
+}
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-hibernate-validator</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
import io.jooby.hibernate.validator.HibernateValidatorModule;
+import io.jooby.hibernate.validator.HibernateValidatorModule;
{
install(new HibernateValidatorModule());
-}
+}
import io.jooby.annotation.*;
+import io.jooby.annotation.*;
import jakarta.validation.Valid;
@Path("/mvc")
@@ -663,9 +663,9 @@ (4)
...
}
-}
+}
import io.jooby.validation.BeanValidator;
+import io.jooby.validation.BeanValidator;
{
use(BeanValidator.validate());
@@ -728,9 +728,9 @@
+}
{
+{
install(new JacksonModule());
install(new HibernateValidatorModule()
.statusCode(StatusCode.BAD_REQUEST)
.validationTitle("Incorrect input data")
);
-}
+}
{
+{
install(new JacksonModule());
install(new HibernateValidatorModule().disableViolationHandler());
error(ConstraintViolationException.class, new MyConstraintViolationHandler());
-}
+}
import io.jooby.hibernate.validator.HibernateValidatorModule;
+import io.jooby.hibernate.validator.HibernateValidatorModule;
{
install(new GuiceModule()); (1)
install(new HibernateValidatorModule());
-}
+}
import jakarta.validation.Validator;
+import jakarta.validation.Validator;
import jakarta.inject.Inject;
@Path("/mvc")
@@ -907,7 +907,7 @@
+}
public class MyConstraintValidatorFactory implements ConstraintValidatorFactory {
+public class MyConstraintValidatorFactory implements ConstraintValidatorFactory {
private final Function<Class<?>, ?> require;
private final ConstraintValidatorFactory defaultFactory;
@@ -964,7 +964,7 @@
+}
{
+{
install(new HibernateValidatorModule().doWith(cfg -> {
cfg.constraintValidatorFactory(new MyConstraintValidatorFactory(this::require)); (1)
}));
-}
+}
hibernate.validator.fail_fast = true
+hibernate.validator.fail_fast = true
import io.jooby.hibernate.validator.HibernateValidatorModule;
+import io.jooby.hibernate.validator.HibernateValidatorModule;
{
install(new HibernateValidatorModule().doWith(cfg -> {
cfg.failFast(true);
}));
-}
+}
<!-- DataSource via HikariCP-->
+<!-- DataSource via HikariCP-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-hikari</artifactId>
- <version>3.5.0</version>
+ <version>3.5.1</version>
</dependency>
<!-- Hibernate Module-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-hibernate</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java.version}</version>
-</dependency>
+</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.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java.version}</version>
-</dependency>
+</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.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
+ <version>3.5.1</version>
</dependency>
<!-- Jdbi Module-->
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jdbi</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java.version}</version>
-</dependency>
+</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.5.0</version>
-</dependency>
+ <version>3.5.1</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.6</version>
<scope>runtime</scope>
</dependency>
-<dependencies>
+<dependencies>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-jte</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-kafka</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
-</dependency>
+ <version>3.5.1</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 MetricsModule());
// 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.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
+ <version>3.5.1</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>2.2.25</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.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-redoc</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<dependency>
+<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-pac4j</artifactId>
- <version>3.5.0</version>
-</dependency>
+ <version>3.5.1</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>6.0.6</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>6.0.6</version>
-</dependency>
+</dependency>
<dependency>
+<dependency>
<groupId>org.pac4j</groupId>
<artifactId>pac4j-jwt</artifactId>
<version>6.0.6</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.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
-</dependency>
+ <version>3.5.1</version>
+</dependency>
<plugin>
+<plugin>
<groupId>com.fizzed</groupId>
<artifactId>rocker-maven-plugin</artifactId>
<version>1.4.0</version>
@@ -627,9 +627,9 @@
+</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.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
-</dependency>
+ <version>3.5.1</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.5.0</version>
-</dependency>
+ <version>3.5.1</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>
<artifactId>maven-compiler-plugin</artifactId>
@@ -631,15 +631,15 @@
+ </build>
dependencies {
- annotationProcessor "io.jooby:jooby-apt:3.5.0"
-}
+dependencies {
+ annotationProcessor "io.jooby:jooby-apt:3.5.1"
+}
<build>
+ <build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
@@ -847,9 +847,9 @@
+ </build>
tasks.withType(JavaCompile) {
+tasks.withType(JavaCompile) {
options.compilerArgs << '-parameters'
options.debug = true
-}
+}