Skip to content

Instantly share code, notes, and snippets.

@fercomunello
Created August 24, 2021 00:36
Show Gist options
  • Save fercomunello/a5ef107b1f492971b87884b6235d5c27 to your computer and use it in GitHub Desktop.
Save fercomunello/a5ef107b1f492971b87884b6235d5c27 to your computer and use it in GitHub Desktop.
<%@ page import="java.time.format.DateTimeFormatter" %>
<%@ page import="java.time.format.FormatStyle" %>
<jsp:useBean id="currentDate" type="java.time.LocalDate" scope="request" />
<jsp:useBean id="user" type="java.lang.String" scope="request" />
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
<title>Jakarta EE - Demo</title>
<style>
body {
font-family: Arial, sans-serif;
}
</style>
</head>
<body>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/Duke_%28Java_mascot%29_waving.svg/568px-Duke_%28Java_mascot%29_waving.svg.png" width="64" height="100" alt="Dukes"/>
<h1>Hello, ${user}!</h1>
<p><% DateTimeFormatter dateFormatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL);
out.print(dateFormatter.format(currentDate)); %>
</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment