对于Tomcat5.0我真的是苦笑不得,用它来做服务器,开发简便,开发速度快,可是这只猫还不很听话,可能是我还没能完全驯服它吧,哈哈,看来我不适合养猫!!
用它开发了两个网站了,结果发现其中很特别的是,比如我网站的根目录名称是www,那么如果我要在其中为管理员做目录的时候,就不能使用名称为admin的目录,不然会出现各种错误,比如:
下面的一个文件:c.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<jsp:useBean id="data" scope="page" class="sql.DBPool"/>
<jsp:useBean id="str" class="tools.str_filter" scope="page"/>
<html>
<head>
<body bgcolor=#ffffff leftmargin="0" topmargin="0">
<table width="400" height="365" border="0" cellpadding="5">
<tr>
<td height="163" valign="top"><table width="408" border="0">
<tr>
<td width="402" height="26"><table width="400" border="0">
<tr>
<td width="20%" align="left>最新动态</td>
<td align="left"><img src="img/pixel_line.gif" width="157" height="9"></td>
</tr>
</table></td>
</tr>
<%
ResultSet rs=null;
String sql="select id,subject,issue_time from news order by issue_time desc";
rs=data.executeQuery(sql);
int i=0;
while((rs.next())&&(i<5)){
%>
<tr>
<td><table width="100%" border="0">
<tr valign="middle">
<td width="5%" align="right"><img src="img/arrow.gif" width="7" height="7"></td>
<td width="65%"><a href="../../news/detail.jsp?id=<%=rs.getString("id")%>" target="_blank"><%=rs.getString("subject")%></a></td>
<td width="30%" align="right">[<%=(rs.getString("issue_time")).substring(0,10)%>]</td>
</tr>
</table></td>
</tr>
<%
i++;
}
rs.close();
%>
<tr>
<td align="right"><a href="../../news/index.jsp"><img src="img/more2.gif" width="59" height="13" border="0"></a></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="bottom"><table width="408" border="0">
<tr>
<td width="402" height="26"><table width="400" border="0">
<tr>
<td width="5%" align="center"><img src="img/bar_butn_4.gif" width="18" height="18"></td>
<td width="20%" align="left"><span class="style11">下载特区</span></td>
<td align="left"><img src="img/pixel_line.gif" width="157" height="9"></td>
</tr>
</table></td>
</tr>
<%
String ssql="select id,subject,pubtime from download order by pubtime desc";
rs=data.executeQuery(ssql);
int j=0;
while((rs.next())&&(j<5)){
%>
<tr>
<td><table width="100%" border="0">
<tr valign="middle">
<td width="5%" align="right"><img src="img/arrow.gif" width="7" height="7"></td>
<td width="65%"> <a href="../../download/detail.jsp?id=<%=rs.getString("id")%>" target="_blank"><%=rs.getString("subject")%></a></td>
<td width="30%" align="right">[<%=(rs.getString("pubtime")).substring(0,10)%>]</td>
</tr>
</table></td>
</tr>
<%
j++;
}
data.close();
%>
<tr>
<td align="right"><a href="download_index.do"><img src="img/more2.gif" width="59" height="13" border="0"></a></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
将他放在除了admin的任何目录下均能正常显示,可是只要是放到admin目录下tomcat就会当掉,真不知道是什么原因,哪位大虾知道还请给解释下,多谢了!
所以以后再做什么我都不会在命名admin的目录了,究竟是为什么还不知道,准备去查一下,为了这个问题我调试了2个多小时,真是郁闷................