ルートに一致するこのサーブレットを見ています:
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
for (Map.Entry<Function<HttpServletRequest, Matcher>, Handler<Matcher>> handlerEntry : handlerMap.entrySet()) {
Matcher matcher = handlerEntry.getKey().apply(req);
if (matcher != null) {
resp.setCharacterEncoding("utf-8");
resp.setContentType("text/html");
handlerEntry.getValue().handle(req, resp, matcher);
return;
}
}
resp.setStatus(404);
}
参照:https ://github.com/spullara/twickery/blob/master/src/main/java/twickery/web/Router.java#L59
ビューテンプレートはここで確認できます:https ://github.com/spullara/twickery/tree/master/src/main/resources/templates
それらがどのようにリンクされているかについて混乱しています。どういうわけかサーブレットから戻ってきたと思います。どこかで戻りを受け取り、それを「モデル」として使用してビューに挿入します。
誰かが私のためにこれを明確にすることができますか?