<%@ page import="java.util.Calendar"%>
<%! private int count=0;
public int getCount()
{
return ++count;
}
%><b>
<% 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>
Your IP:<%=request.getRemoteAddr()%>
播放视频的!
<img src="poem.gif" dynsrc="SAMPLE-S.avi" loop=infinite>
<%! private int count=0;
public int getCount()
{
return ++count;
}
%><b>
<% 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>
Your IP:<%=request.getRemoteAddr()%>
播放视频的!
<img src="poem.gif" dynsrc="SAMPLE-S.avi" loop=infinite>
本文介绍了一个简单的JSP页面实现,该页面能够显示针对不同时间段的个性化问候,并记录页面访问次数。此外,还展示了如何获取客户端IP地址以及使用HTML标签进行基本布局。
3527

被折叠的 条评论
为什么被折叠?



