首页 新闻 会员 周边 捐助

关于JSP中的菜单问题,请大神指导。

0
悬赏园豆:10 [已关闭问题] 关闭于 2016-09-23 16:51

代码:

<%@ page language="java" import="java.util.*" pageEncoding="utF-8" errorPage="error.jsp"%>
<%@page import="entity.MenuEntity" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>

<body>
<jsp:useBean id="menu" class="entity.MenuEntity"></jsp:useBean>
<table>
<tr>
<td>${menu.titles[0]}</td>
<td>${menu.titles[1]}</td>
<td>${menu.titles[2]}</td>
<td>${menu.titles[3]}</td>
<td>${menu.titles[4]}</td>
</tr>
</table>

</body>
</html>

package entity;

public class MenuEntity {
private String titles[];
public MenuEntity(){
titles=new String[5];
titles[0]="首页";
titles[1]="博主简介";
titles[2]="旅游";
titles[3]="摄影";
titles[4]="户外运动";
}
public String[] getTitles(){
return titles;
}
public void setTitles(String[] titles){
this.titles=titles;
}
}

错误:

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.test2_jsp
	org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:177)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

 

root cause

java.lang.ClassNotFoundException: org.apache.jsp.test2_jsp
	java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	java.security.AccessController.doPrivileged(Native Method)
	java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
	org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
	org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

 

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.27 logs.


Apache Tomcat/7.0.27

JAVA梦想家的主页 JAVA梦想家 | 初学一级 | 园豆:192
提问于:2016-09-23 00:31
< >
分享
所有回答(1)
0

你都不写出现什么问题了

钓一条大鱼 | 园豆:164 (初学一级) | 2016-09-23 02:54

我访问的时候出错了,出错的页面我已经复制上去了,源代码也复制上去了,我找不到错误在哪

支持(0) 反对(0) JAVA梦想家 | 园豆:192 (初学一级) | 2016-09-23 07:20
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册