当前位置: 代码迷 >> Java Web开发 >> 菜鸟有关问题,哪位大哥帮小弟我看看,有什么有关问题
  详细解决方案

菜鸟有关问题,哪位大哥帮小弟我看看,有什么有关问题

热度:201   发布时间:2016-04-17 12:35:53.0
初学者问题,哪位大哥帮我看看,有什么问题?
<%@page contentType="text/html";charset="GB2312"%>
<%@page import="java.util.*"%>
<html>
<head>
<title>Document Title</title>
</head>
<body>
<center><font color=blue size=10 face="隶书">
<%
date today=new date();
int hours=today.getHours();
int minute=today.getminutes();
if(hours>0&&hours<12)
{
out.println("good moring!")
}
else
{
out.println("good afternoon")
}
string[] weekdays={"日","一","二","三","四","五","六"};
out.println("\n今天是")+today.getyear()+1900)+"年"+
(today.getmonth()+1)+"月"+(today.getdate())+"日星期"+
weekdays[today.getday()];
%>
</font></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: org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

------解决方案--------------------
Unable to load class for JSP,JSP页面写错了,像下面这样就可以了(不要灰心,慢慢来,以后注意大小写的问题):
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html > 
<head > 
<title >Document Title </title > 
</head > 
<body > 
<center > <font color=blue size=10 face="隶书" > 
<% 
Date today=new Date(); 
int hours=today.getHours(); 
int minute=today.getMinutes(); 
if(hours >0&&hours <12) 

out.println("good moring!");

else 

out.println("good afternoon"); 

String[] weekdays={"日","一","二","三","四","五","六"}; 
out.println("\n今天是"+(today.getYear()+1900)+"年"+ 
(today.getMonth()+1)+"月"+(today.getDate())+"日星期"+ 
weekdays[today.getDay()]); 
%> 
</font > </center > 
</body > 
</html > 

代码迷推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.daimami.com/search?q=317
  相关解决方案