date()是不是一个函数呀
可不可以这么用我就不知道了呀
你想输出DATE()你可以用这个
在<BODY>和</BODY>之间加<!--
todayDate = new Date();
date = todayDate.getDate();
month= todayDate.getMonth() +1;
year= todayDate.getYear();
document.write("今天是")
document.write("<br>")
if(navigator.appName == "Netscape")
{
document.write(1900+year);
document.write("年");
document.write(month);
document.write("月");
document.write(date);
document.write("日");
document.write("<br>")
}
if(navigator.appVersion.indexOf("MSIE") != -1)
{
document.write(year);
document.write("年");
document.write(month);
document.write("月");
document.write(date);
document.write("日");
document.write("<br>")
}
if (todayDate.getDay() == 5) document.write("星期五")
if (todayDate.getDay() == 6) document.write("星期六")
if (todayDate.getDay() == 0) document.write("星期日")
if (todayDate.getDay() == 1) document.write("星期一")
if (todayDate.getDay() == 2) document.write("星期二")
if (todayDate.getDay() == 3) document.write("星期三")
if (todayDate.getDay() == 4) document.write("星期四")//-->

解决方案 »

  1.   

    谢谢啊,可是现在的问题是,无法执行java语句
    我试了一下,还是不行啊!
    继续求救
      

  2.   

    是jsp文件没有解析的问题吧。错误是说页面找不到吗?
      

  3.   

    全部过程:
        安装j2sdk1.5.0到E盘: 设置path=E:\j2sdk1.5.0\bin  设置JAVA_HAME=E:\j2sdk1.5.0  设置CLASSPATH=E:\j2sdk1.5.0\lib\tools.jar;E:\j2sdk1.5.0\lib\dt.jar
        安装tomcat到E盘E:\Program Files\Apache Software Foundation\Tomcat 5.0:设置Tomcat_Home=E:\Program Files\Apache Software Foundation\Tomcat 5.0
        在浏览器输入http://localhost:8080,可以显示主页,但是java部分显示不出来
      

  4.   

    啊,出现了这样的错误提示
    org.apache.jasper.JasperException: Unable to compile class for JSPNo Java compiler was found to compile the generated source for the JSP. 
    This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK 
    to the common/lib directory of the Tomcat server, followed by a Tomcat restart. 
    If using an alternate Java compiler, please check its installation and access path.
    是什么意思啊?
      

  5.   

    设置没有问题,JAVA 部分不显示有出错信息吗? 看看 E:\Program Files\Apache Software Foundation\Tomcat 5.0\logs 下面 stdout.log 文件,把里面的内容最好能贴出来
      

  6.   

    你重新启动计算机了吗? 用的什么系统? 如果是 2000 以上,就不用重新启动了,重新启动一下Tomcat 服务器就好了
      

  7.   

    我的系统是XP,stdout.log文件里的东西太多了,我只贴出最后面的那些把信息: Installing web application at context path  from URL file:E:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ROOT
    2004-10-24 15:12:52 org.apache.catalina.core.StandardHostDeployer install
    信息: Installing web application at context path /servlets-examples from URL file:E:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\servlets-examples
    2004-10-24 15:12:53 org.apache.catalina.core.StandardHostDeployer install
    信息: Installing web application at context path /test from URL file:E:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\test
    2004-10-24 15:12:54 org.apache.catalina.startup.ContextConfig applicationConfig
    信息: Missing application web.xml, using defaults only StandardEngine[Catalina].StandardHost[localhost].StandardContext[/test]
    2004-10-24 15:12:54 org.apache.catalina.core.StandardHostDeployer install
    信息: Installing web application at context path /tomcat-docs from URL file:E:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\tomcat-docs
    2004-10-24 15:12:55 org.apache.coyote.http11.Http11Protocol start
    信息: Starting Coyote HTTP/1.1 on port 8080
    2004-10-24 15:12:55 org.apache.jk.common.ChannelSocket init
    信息: JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009
    2004-10-24 15:12:55 org.apache.jk.server.JkMain start
    信息: Jk running ID=0 time=20/130  config=E:\Program Files\Apache Software Foundation\Tomcat 5.0\conf\jk2.properties
    2004-10-24 15:12:55 org.apache.catalina.startup.Catalina start
    信息: Server startup in 9754 ms
      

  8.   

    This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK 
    to the common/lib directory of the Tomcat server, followed by a Tomcat 
    这里是说在Tomcat 5.0 common/lib 目录下缺tools.jar
    在 j2sdk1.5.0 lib/目录拷贝一个
      

  9.   

    它那里不是说了,,把$JAVA_HOME/lib/tools.jar考过去啊