jspÖÐÈ¡µÃ·þÎñÆ÷ʱ¼ä²¢¶¯Ì¬ÏÔʾ
<%
Calendar rightNow = Calendar.getInstance();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String sysdate = format.format(rightNow.getTime());
int week = rightNow.get(rightNow.DAY_OF_WEEK);
String weekary[] ={"ÔÂê×ÈÕ","»ðê×ÈÕ","Ë®ê×ÈÕ","ľê×ÈÕ","½ðê×ÈÕ","ÍÁê×ÈÕ","ÈÕê×ÈÕ"};
%>
<script language="javascript">
//´Ó·þÎñÆ÷ÉÏ»ñÈ¡³õʼʱ¼ä
var currentDate = new Date(<%=new java.util.Date().getTime()%>);
function run()
{
currentDate.setSeconds(currentDate.getSeconds()+1);
document.getElementById("dt").innerHTML =
currentDate.toLocaleString();
}
window.setInterval("run();", 1000);
</script>
<div id="dt">×Ô¶¯ÏÔʾʱ¼ä¡£¡£¡£¡£</div>
Ïà¹ØÎĵµ£º
Cookie¸ÅÄî:
CookieµÄ¸ñʽʵ¼ÊÉÏÊÇÒ»¶Î´¿Îı¾ÐÅÏ¢, ÓÉ·þÎñÆ÷Ëæ×ÅÍøÒ³Ò»Æð·¢Ë͵½¿Í»§¶Ë, ²¢±£´æÔÚ¿Í»§¶ËÓ²ÅÌÖÐÖ¸¶¨µÄĿ¼µÄ. ´ó¼Ò¶¼´«ËµCookie»áÔì³ÉÑÏÖصݲȫÍþвʲôµÄ, Æäʵ²»ÊÇÕâô»ØÊÂÇé. ·þÎñÆ÷¶ÁÈ¡CookieµÄʱºò, Ö»Äܹ»¶ÁÈ¡µ½Õâ¸ö·þÎñÆ÷Ïà¹ØµÄÐÅÏ¢. ¶ø ......
1¡¢<%=(new java.util.Date()).toLocaleString()%>
2¡¢<script language= "javascript ">
var today=new Date()
var month=today.getMonth()+1
document.write(today.getYear()+ "Äê "+month+ "ÔÂ "+today.getDate()+ "ÈÕ ")
  ......
1. jspÒ³ÃæÏÔʾÖÐÎÄÂÒÂ룺
jspÒ³ÃæµÄ±àÂ뷽ʽÓÐÁ½¸öµØ·½ÐèÒªÉèÖãº
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html;charset=utf-8"%>
ÆäÖУºpageEncoding Ö¸µÄÊÇjspÎļþ±¾É ......
ÎÒÃǶ¼ÖªµÀÔÚjspÖÐincludeÓÐÁ½ÖÖÐÎʽ,·Ö±ðÊÇ
<%@ include file=” ”%>
<jsp:include page=” ” flush=”true”/>
Ç°ÕßÊÇÖ¸ÁîÔªËØ¡¢ºóÕßÊÇÐÐΪԪËØ¡£¾ßÌåËüÃǽ«Ôںδ¦Óã¿ÈçºÎÓü°ËüÃÇÓÐʲôÇø±ð£¿ÕâÓ¦¸ÃÊǺܶàÈË¿´ ......
Ô´´úÂ룬a.jspÍùb.jsp´«Öµ£º
a.jspÒ³ÃæÄÚÈÝ
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<form action="b.jsp">
¡¡¡¡name:<input type=text name=name>
¡¡¡¡<input type=submit>
</form>
b.jspÒ³ÃæÄÚÈÝ£º
<%@ page language="java" import="java.ut ......