<%@ page contentType=="text/html;charset=gb2312"%> <%@ page import="java.util.*"%> <html> <title>获得当前日期</title> <body> <center> <font size = 5 color=blue>获得当前日期</font> <br> <hr> <%
Date today = new Date(); int hours=today.getHours(); int minute=today.getMinutes();
if (hours>0 && hours<12) out.println("早上好!"); else out.println("下午好!");
String[] weekdays={"日","一","二","三","四","五","六"}; out.println("\n今天是" +(today.getYear()+1990+"年" +today.getMonth()+"月" +today.getDate()+"日星期" +weekdays[today.getDay()]));
%> </center> </body> </html>
在出现如下错误提示,请帮忙看一下:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /wlh-test/time.jsp(1,23) quote symbol expected org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:126) org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:245) org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:190) org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:203) org.apache.jasper.compiler.ParserController.getPageEncodingForJspSyntax(ParserController.java:443) org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:413) org.apache.jasper.compiler.ParserController.parse(ParserController.java:197) org.apache.jasper.compiler.ParserController.parse(ParserController.java:149) org.apache.jasper.compiler.ParserController.parse(ParserController.java:135) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:243) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:437) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:555) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:285) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:232) javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.