Commit a417f966 by Patryk Czarnik

Która godzina - wersja HTML

parent adc6ab85
......@@ -15,9 +15,14 @@ public class KtoraGodzina extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/plain");
response.setContentType("text/html");
response.setCharacterEncoding("utf-8");
PrintWriter out = response.getWriter();
out.println("Bieżący czas: " + LocalDateTime.now());
out.println("<!DOCTYPE html>");
out.println("<html><body>");
out.println("<h1>Która godzina</h1>");
out.println("<div>Bieżący czas: <strong style='color: blue'>" + LocalDateTime.now() +"</strong></div>");
out.println("</body></html>");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment