/
NikolayIvkin
/
tutorials1
Обзор
Документация
Войти
/
NikolayIvkin
/
tutorials1
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
web-modules/java-takes/src/main/java/com/baeldung/takes/TakesIndex.java
24 строки
650 B
panos-kakos
[JAVA-22519] Move articles from generic libraries module to specific library modules (#15416)
21 дек 2023, 11:30
21 дек 2023, 11:30
5e4ca88
Код
Авторство
О чём код?
package com.baeldung.takes; import java.io.IOException; import org.takes.Request; import org.takes.Response; import org.takes.Take; import org.takes.rq.form.RqFormSmart; 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)) ); } }