Tuesday, October 20, 2009

JSP - print direct to html

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
        <title>JSP print straight out example</title> 
            out.println("<h1>Print directly example</h1>");
            out.println("Here is the date:<br />");
            out.println(new java.util.Date());
my output: 
    Print directly example 
    Here is the date: 
    Tue Oct 20 11:21:21 MDT 2009 

No comments:

Post a Comment