Knowledgebase: Java/JSP Hosting Plans
The Quintessential JSP Page
Posted by Customer Service on 25 May 2005 12:52 AM
A JSP page consists of template text with embedded JSP elements. Template text is automatically written to the output stream while the embedded JSP elements are executed. Here is a simple JSP page:
    <html>
<head>
<title>A Simple JSP Page</title>
</head>
<body>
<pre>

This is template text; it is automatically written to the output
stream.

<hr>

<%-- This is a JSP comment --%>

<hr>

<%
// This is a scriptlet; it contains Java code
%>

<hr>

The following is a JSP expression; it is used to emit dynamic
text to the output stream:
The current date is <%= new java.util.Date() %>

<hr>

The following is a directive that includes other files:
<%@ include file="fragment.jsp" %>
</pre>
</body>
(562 vote(s))
Helpful
Not helpful

Comments (0)