用java写了几个包,用jsp访问包中的内容时,出现以下问题:org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 27 in the jsp file: /show.jspGenerated servlet error:
[javac] Compiling 1 source fileC:\Program Files\Apache Software Foundation\Tomcat 6.0\work\Catalina\localhost\TSS_final\show_jsp.java:8: 软件包 form 不存在
import form.BBS_form;
^
C:\Program Files\Apache Software Foundation\Tomcat 6.0\work\Catalina\localhost\TSS_final\show_jsp.java:9: 软件包 Query 不存在
import Query.TSSQuery;
^
C:\Program Files\Apache Software Foundation\Tomcat 6.0\work\Catalina\localhost\TSS_final\show_jsp.java:69: 软件包 Query 不存在
Query.TSSQuery query = null;
^查看项目目录下WebRoot\WEB-INF\classes中明明有form和Query文件夹,里面也有相应的.class文件。求高手指点。show.jsp代码如下:<%@ page language="java" import="java.util.*" import="form.BBS_form" import="Query.TSSQuery" pageEncoding="UTF-8"%>
<%
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>为您展示相关内容</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">
-->
<style type="text/css">
<!--
.STYLE1 {color: #000000}
-->
</style>
</head>
<jsp:useBean id="query" class="Query.TSSQuery" scope="page"></jsp:useBean>
<%
String temp=(String)request.getAttribute("result");
String[] fin=temp.split("_");
ArrayList<BBS_form> BBS=query.executequery(fin[0],fin[1],fin[2]);
//out.print(BBS.size());
%>
<body>
<table width="800" height="392" border="1" align="center" bordercolor="#CCCCCC" bgcolor="#FFFFFF">
<tr>
<th>
<p align="center">共为您查询出<%out.print(BBS.size());%>
条相关的页面:<a href="index.jsp">返回主页</a></p>
<div align="center">
<table border="1" bordercolor="#999966" bgcolor="#FFFFFF">
<tr>
<%
for(int i=0;i<BBS.size();i++){
BBS_form res=BBS.get(i);
String name=res.geturl().replaceAll("d:/","../TSS_final/");
%>
<td width="398" bgcolor="#FFFFFF" scope="row"><%=i+1 %>楼:<%=res.getname() %>(帖子总分:<%=res.getscore()%>)<a href=<%=name %>>原帖链接</a></td>
<td width="166" align="center"><a href="servlet_ans?BBS_id=<%=res.getid()%>&key=<%=fin[0]%>">查看解决方案</a></td>
</tr>
<tr>
<td align="left" valign="middle" bgcolor="#FFFFFF" scope="row"><span class="STYLE1"><%=res.getcontent() %></span></td>
<td align="left" valign="top" bgcolor="#FFFFFF">相关度:<%=res.getrel() %></td>
</tr>
<%}%>
</table>
</div>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p></th>
</tr>
</table>
</body>
</html>
[javac] Compiling 1 source fileC:\Program Files\Apache Software Foundation\Tomcat 6.0\work\Catalina\localhost\TSS_final\show_jsp.java:8: 软件包 form 不存在
import form.BBS_form;
^
C:\Program Files\Apache Software Foundation\Tomcat 6.0\work\Catalina\localhost\TSS_final\show_jsp.java:9: 软件包 Query 不存在
import Query.TSSQuery;
^
C:\Program Files\Apache Software Foundation\Tomcat 6.0\work\Catalina\localhost\TSS_final\show_jsp.java:69: 软件包 Query 不存在
Query.TSSQuery query = null;
^查看项目目录下WebRoot\WEB-INF\classes中明明有form和Query文件夹,里面也有相应的.class文件。求高手指点。show.jsp代码如下:<%@ page language="java" import="java.util.*" import="form.BBS_form" import="Query.TSSQuery" pageEncoding="UTF-8"%>
<%
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>为您展示相关内容</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">
-->
<style type="text/css">
<!--
.STYLE1 {color: #000000}
-->
</style>
</head>
<jsp:useBean id="query" class="Query.TSSQuery" scope="page"></jsp:useBean>
<%
String temp=(String)request.getAttribute("result");
String[] fin=temp.split("_");
ArrayList<BBS_form> BBS=query.executequery(fin[0],fin[1],fin[2]);
//out.print(BBS.size());
%>
<body>
<table width="800" height="392" border="1" align="center" bordercolor="#CCCCCC" bgcolor="#FFFFFF">
<tr>
<th>
<p align="center">共为您查询出<%out.print(BBS.size());%>
条相关的页面:<a href="index.jsp">返回主页</a></p>
<div align="center">
<table border="1" bordercolor="#999966" bgcolor="#FFFFFF">
<tr>
<%
for(int i=0;i<BBS.size();i++){
BBS_form res=BBS.get(i);
String name=res.geturl().replaceAll("d:/","../TSS_final/");
%>
<td width="398" bgcolor="#FFFFFF" scope="row"><%=i+1 %>楼:<%=res.getname() %>(帖子总分:<%=res.getscore()%>)<a href=<%=name %>>原帖链接</a></td>
<td width="166" align="center"><a href="servlet_ans?BBS_id=<%=res.getid()%>&key=<%=fin[0]%>">查看解决方案</a></td>
</tr>
<tr>
<td align="left" valign="middle" bgcolor="#FFFFFF" scope="row"><span class="STYLE1"><%=res.getcontent() %></span></td>
<td align="left" valign="top" bgcolor="#FFFFFF">相关度:<%=res.getrel() %></td>
</tr>
<%}%>
</table>
</div>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p></th>
</tr>
</table>
</body>
</html>
解决方案 »
- java web 实现网络直播功能?
- java.lang.StringIndexOutOfBoundsException: String index out of range: -6
- 使用lucene问题,初级问题
- 为什么tomcat下无法运行两个struts2项目?
- #########################JSP文件里面的<html:form>和<bean:write>等tag为什么不认阿?
- 一个关于表达式语言的问题,为什么我在TOMCATE行,WEBLOGIC上不行
- HTTP Status 500
- 怎么在jsp中读取action中的Map集合里面的值呢?
- 如何在JSP里面做个分页显示,就象本论坛的这样?
- javaBean的释构函数是哪一个?
- struts2.1.8.1 + urlrewrite 实现全静态URL的问题
- tomcat动态加载JAR,class
如果是那样就重新安装Eclipse 应该是配置出问题了