UP PREVIOUS NEXT   Technologies Internet et Education, © TECFA
  3. Utilisation d'autres classes JAVA

3. Utilisation d'autres classes JAVA

import="java.util.Date"
%>

Exemple 3-1: Dates avec JSP

<%@ page 
import="java.util.Date"
%>
 
<html><head><title>Today</title></head><body>
<h1>Today</h1>
<%
// Maps day number to a name
String days [] = { "Dimanche", "Lundi", "Mardi", "Mercredi",
                   "Jeudi", "Vendredi", "Samedi" };
// Get today's date
Date today = new Date ();
int weekday = today.getDay ();
out.println ("<p>On est " + days [weekday] + " aujourd'hui!");
%>
</body></html>

UP PREVIOUS NEXT -- TIE