Takes - review changes
This commit is contained in:
parent
c82c692eb3
commit
93e7e1a51c
|
@ -10,10 +10,13 @@ import org.takes.rs.RsWithStatus;
|
|||
import org.takes.rs.RsWithType;
|
||||
|
||||
public final class TakesContact implements Take {
|
||||
|
||||
|
||||
@Override
|
||||
public Response act(Request req) throws IOException {
|
||||
return new RsWithStatus(new RsWithType(new RsWithBody("Contact us at https://www.baeldung.com"), "text/html"), 200);
|
||||
}
|
||||
return new RsWithStatus(
|
||||
new RsWithType(
|
||||
new RsWithBody("Contact us at https://www.baeldung.com"),
|
||||
"text/html"), 200);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,12 +10,15 @@ import org.takes.rs.RsHtml;
|
|||
import org.takes.rs.RsVelocity;
|
||||
|
||||
public final class TakesIndex implements Take {
|
||||
|
||||
|
||||
@Override
|
||||
public Response act(final Request req) throws IOException {
|
||||
RqFormSmart form = new RqFormSmart(req);
|
||||
String username = form.single("username");
|
||||
return new RsHtml(new RsVelocity(this.getClass().getResource("/templates/index.vm"), new RsVelocity.Pair("username", username)));
|
||||
return new RsHtml(
|
||||
new RsVelocity(this.getClass().getResource("/templates/index.vm"),
|
||||
new RsVelocity.Pair("username", username))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue