JSP中的几个实用函数的详细介绍

JSP中的几个实用函数的详细介绍

<%@ page import="java.util.Calendar"%>
<%! private int count=0;
public int getCount()
{
return ++count;
}
%><b>&nbsp;
<% Calendar calendar=Calendar.getInstance();
int hourOfDay=calendar.get(Calendar.HOUR_OF_DAY);
if(hourOfDay<=12){
%>Good morning!
<%}else if(hourOfDay<=18){
%>Good afternoon!
<%}else {
%>Good evening!
<%}%>
This is the <font color=red size=+1><%=getCount()%></font> time this page has been visited!</b>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Your IP:<%=request.getRemoteAddr()%>


播放视频的!
<img src="poem.gif" dynsrc="SAMPLE-S.avi" loop=infinite>