The requested resource () is not available.怎么改正啊?

xttgx 2009-05-30 06:58:46
tomcat经常会提示这样的错误,真不知错在哪里。
附上全部代码:
<%@ page language="java" import="java.util.*" contentType="text/html;charset=GBK"%>
<%@ page import="java.text.*,votebean.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<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">
-->

</head>

<body>
<%Questions question=(Questions)request.getAttribute("question");
Collection c=question.getItem();
Date startTime=question.getStartime();
Date endTime=question.getEndtime();
Date now=new Date();
String errorMsg="<font color=\"#FF0000\">投票过程正常中!</font>";
int status=1;
if(now.before(startTime)){
errorMsg="<font color=\"#FF0000\">投票尚未开始</font>";
status=0;
}else if(now.after(endTime)){
errorMsg="<font color=\"#FF0000\">投票已经结束</font>";
status=0;
}else if(question.getActive()==0){
errorMsg="<font color=\"#FF0000\">投票已经关闭</font>";
status=0;
}
NumberFormat nf=NumberFormat.getPercentInstance();
%>
<table width="80%" border="0" align="center"><tr>
<td bgcolor="#CCFFCC" colspan="3" align="center" ><b><%=errorMsg %>
</b></td>
</tr>
</table>
<table width="80%" border="0" align="center"><tr>
<td bgcolor="#C0C0C0" colspan="3" align="center" ><b><font color="#0000FF">投票结果</font>
</b></td>
</tr>
</table>
<table width="80%" border="0" align="center"><tr>
<td bgcolor="#FFCC99" colspan="3" align="center" ><u> <b>主题:<%=question.getTitle() %>
</b></u></td>
</tr>
<tr>
<td colspan="3" align="center" valign="middle">现在总票数<b><font color="#0000FF"><%=question.getVotecount()%></font>
</b></td>
</tr>
</table>
<table width="80%" border="0" align="center">
<%if((c!=null)&& (question.getVotecount()>0)){
Iterator iterator=c.iterator();
int i=1;
Item item=null;
while(iterator.hasNext()){
item=(Item)iterator.next();
%>
<tr>
<td align="left" bgcolor="#CCCCFF">[<%=i %>]
<%=item.getOptions() %>
</td>
<td align="left" bgcolor="#CCCCFF"><img border="0" height="10"
width="<%=((double)item.getVote()*100/question.getVotecount()) %>">
<%=nf.format((double)item.getVote()/question.getVotecount()) %>
(<%=item.getVote() %>)</td>
</tr>
<%i++;}
}
%>
</table>
<table width="80%" border="0" align="center">
<tr>
<td align="center" valign="middle"><%if(status==1){ %><a href="servlet/ShowVoteServlet?id=<%=question.getId() %>&page=/admin/vote.jsp ">
我要投票</a>|
<%} %>
<a href="servlet/BrowseVoteServlet?type=admin">返回首页</a></td>
</tr>
</table>
</body>
</html>
...全文
136 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
qiheia 2009-05-30
  • 打赏
  • 举报
回复
requested resource () is not available.
请求资源无效,看下你的请求路径是否写对,配置文件是否写对。。。
xttgx 2009-05-30
  • 打赏
  • 举报
回复
再加一句:我用的是tomcat6.0.13运行的

67,538

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧