JSP Example 1
<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" session="true" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<jsp:useBean id="date" class="java.util.Date" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title><fmt:message key="wsams.title" /></title>
</head>
<body>
<h1><fmt:message key="wsams.title" /></h1>
<div style="background-color:silver;">
<%
for (int i=0; i<10; i++) {
out.println(i + "<br />");
}
%>
<p>Date: <c:out value="${date}" /></p>
<p>Session ID:
<%
out.println(request.getSession().getId());
%>
</p>
</div>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" session="true" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<jsp:useBean id="date" class="java.util.Date" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title><fmt:message key="wsams.title" /></title>
</head>
<body>
<h1><fmt:message key="wsams.title" /></h1>
<div style="background-color:silver;">
<%
for (int i=0; i<10; i++) {
out.println(i + "<br />");
}
%>
<p>Date: <c:out value="${date}" /></p>
<p>Session ID:
<%
out.println(request.getSession().getId());
%>
</p>
</div>
</body>
</html>
[Click to add or edit comments])
Please prepend comments below including a date