21 lines
518 B
Java
Raw Normal View History

2020-02-18 10:50:53 +02:00
package com.baeldung.takes;
import java.io.IOException;
2020-02-21 11:00:23 +02:00
import java.sql.SQLException;
2020-02-18 10:50:53 +02:00
import org.takes.Request;
import org.takes.Response;
import org.takes.Take;
2020-02-21 11:00:23 +02:00
import org.takes.rs.RsHtml;
2020-02-18 10:50:53 +02:00
import org.takes.rs.RsVelocity;
public final class TakesIndex implements Take {
@Override
2020-02-21 11:00:23 +02:00
public Response act(final Request req) throws IOException, SQLException {
return new RsHtml(new RsVelocity(this.getClass().getResource("/templates/index.vm") ,new RsVelocity.Pair("userName", "Anshul")));
2020-02-18 10:50:53 +02:00
}
2020-02-21 11:00:23 +02:00
2020-02-18 10:50:53 +02:00
}