[JAVA-13854] Half list moved (#12598)
* [JAVA-13854] added parent module * [JAVA-13854] moved apache-tapestry(submodule) to web-modules(parent) * [JAVA-13854] moved bootique(submodule) to web-modules(parent) * [JAVA-13854] moved dropwizard(submodule) to web-modules(parent) * [JAVA-13854] moved blade(submodule) to web-modules(parent) * [JAVA-13854] moved java-lite(submodule) to web-modules(parent) * [JAVA-13854] moved jooby(submodule) to web-modules(parent) * [JAVA-13854] moved linkrest(submodule) to web-modules(parent) * [JAVA-13854] moved ninja(submodule) to web-modules(parent) * [JAVA-13854] moved ratpack(submodule) to web-modules(parent) * [JAVA-13854] moved resteasy(submodule) to web-modules(parent) * [JAVA-13854] moved restx(submodule) to web-modules(parent) * [JAVA-13854] moved spark-java(submodule) to web-modules(parent) * [JAVA-13854] moved vraptor(submodule) to web-modules(parent) * [JAVA-13854] delete modules that were moved * [JAVA-13854] * [JAVA-13854] * [JAVA-13854] delete ninja submodule + moved raml(submodule) to web-modules(parent) * [JAVA-13854] moved gwt(submodule) to web-modules(parent) * [JAVA-13854] moved jakarta-ee(submodule) to web-modules(parent) * [JAVA-13854] moved javax-servlets(submodule) to web-modules(parent) * [JAVA-13854] moved javax-servlets-2(submodule) to web-modules(parent) * [JAVA-13854] moved jee-7(submodule) to web-modules(parent) * [JAVA-13854] moved play-framework(not a module) to web-modules * [JAVA-13854] fix failing test * [JAVA-13854] moved struts-2(submodule) to web-modules(parent) * [JAVA-13854] moved wicket(submodule) to web-modules(parent) * [JAVA-13854] deleted modules that were moved to web-modules * JAVA-13854 Removed moved modules from the main pom.xml Co-authored-by: panagiotiskakos <panagiotis.kakos@libra-is.com> Co-authored-by: Dhawal Kapil <dhawalkapil@gmail.com>
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
package com.baeldung.jooby;
|
||||
|
||||
import org.jooby.Jooby;
|
||||
import org.jooby.Mutant;
|
||||
import org.jooby.Session;
|
||||
import org.jooby.jedis.Redis;
|
||||
import org.jooby.jedis.RedisSessionStore;
|
||||
|
||||
import com.baeldung.jooby.bean.Employee;
|
||||
|
||||
public class App extends Jooby {
|
||||
|
||||
{
|
||||
port(8080);
|
||||
securePort(8443);
|
||||
}
|
||||
|
||||
{
|
||||
get("/", () -> "Hello World!");
|
||||
}
|
||||
|
||||
{
|
||||
get("/user/{id}", req -> "Hello user : " + req.param("id").value());
|
||||
get("/user/:id", req -> "Hello user: " + req.param("id").value());
|
||||
get("/uid:{id}", req -> "Hello User with id : uid" + req.param("id").value());
|
||||
}
|
||||
|
||||
{
|
||||
onStart(() -> {
|
||||
System.out.println("starting app");
|
||||
});
|
||||
|
||||
onStop(() -> {
|
||||
System.out.println("stopping app");
|
||||
});
|
||||
|
||||
onStarted(() -> {
|
||||
System.out.println("app started");
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
get("/login", () -> "Hello from Baeldung");
|
||||
}
|
||||
|
||||
{
|
||||
post("/save", req -> {
|
||||
Mutant token = req.param("token");
|
||||
return token.intValue();
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
{
|
||||
assets("/employee", "form.html");
|
||||
}
|
||||
|
||||
post("/submitForm", req -> {
|
||||
Employee employee = req.params(Employee.class);
|
||||
// TODO
|
||||
return "empoyee data saved successfullly";
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
get("/filter", (req, resp, chain) -> {
|
||||
// TODO
|
||||
// resp.send(...);
|
||||
chain.next(req, resp);
|
||||
});
|
||||
get("/filter", (req, resp) -> {
|
||||
resp.send("filter response");
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
// cookieSession();
|
||||
|
||||
// use(new Redis());
|
||||
//
|
||||
// session(RedisSessionStore.class);
|
||||
|
||||
get("/session", req -> {
|
||||
Session session = req.session();
|
||||
session.set("token", "value");
|
||||
return session.get("token").value();
|
||||
});
|
||||
}
|
||||
|
||||
public static void main(final String[] args) {
|
||||
|
||||
run(App::new, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.baeldung.jooby.bean;
|
||||
|
||||
public class Employee {
|
||||
|
||||
String id;
|
||||
String name;
|
||||
String email;
|
||||
|
||||
public Employee(String id, String name, String email) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.baeldung.jooby.mvc;
|
||||
|
||||
import org.jooby.Result;
|
||||
import org.jooby.Results;
|
||||
import org.jooby.mvc.GET;
|
||||
import org.jooby.mvc.Path;
|
||||
|
||||
@Path("/hello")
|
||||
public class GetController {
|
||||
|
||||
@GET
|
||||
public String hello() {
|
||||
return "Hello Baeldung";
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/home")
|
||||
public Result home() {
|
||||
return Results.html("welcome").put("model", new Object());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.baeldung.jooby.mvc;
|
||||
|
||||
import org.jooby.mvc.POST;
|
||||
import org.jooby.mvc.Path;
|
||||
|
||||
@Path("/submit")
|
||||
public class PostController {
|
||||
|
||||
@POST
|
||||
public String hello() {
|
||||
return "Submit Baeldung";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user