Initial commit

This commit is contained in:
Anshul BANSAL
2020-02-18 10:50:53 +02:00
parent 6dcb329bbc
commit acd7d764e2
5 changed files with 125 additions and 0 deletions
@@ -0,0 +1,25 @@
package com.baeldung.takes;
import java.io.IOException;
import org.takes.Request;
import org.takes.Response;
import org.takes.Take;
import org.takes.rs.RsVelocity;
import org.takes.rs.RsWithBody;
import org.takes.rs.RsWithStatus;
import org.takes.rs.RsWithType;
public final class TakesIndex implements Take {
// @Override
// public Response act(Request req) throws IOException {
// return new RsWithStatus(new RsWithType(new RsWithBody("<html>Hello, world!</html>"), "text/html"), 200);
// }
@Override
public Response act(Request req) {
return new RsVelocity("Hello, ${name}", new RsVelocity.Pair("name", "Jeffrey"));
}
}