问题描述:
Web工程--Xiazai; index.jsp<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
<%
System.out.println("1111111111111111111111");
%>
<html>
  <head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta name="Keywords" content=""/>
<meta name="Description" content=""/>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
<title>软件下载</title>
<link rel="stylesheet" type="text/css" href="/muti/style/index.css"/>
  </head>
  <body>
   <%@include file="/include/fc_head.jsp"%>
   <!-- 右侧结束 -->
   </div>
    <%@include file="/include/foot.jsp"%>
    </body>
</html>我用浏览器http://localhost:8080访问后,发现MyEclipse控制台出现
1111111111111111111111
1111111111111111111111
1111111111111111111111
1111111111111111111111
1111111111111111111111
1111111111111111111111
从结果可以看出我只访问了一次,怎么会出现它自动多访问了这么多次?????Web.xml配置如下:
<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
 </welcome-file-list>
  <error-page>
   <error-code>400</error-code>
     <location>/index.jsp</location>
   </error-page>
   <error-page>
      <error-code>404</error-code>
      <location>/index.jsp</location>
  </error-page>
  <error-page>
   <error-code>500</error-code>
     <location>/index.jsp</location>
  </error-page> 
  <error-page>
    <exception-type>java.lang.NullPointerException</exception-type>
     <location>/index.jsp</location>
  </error-page>
请问那位同仁遇到过如此问题,请不吝解答,也请高手解答,谢谢,在线观望。

解决方案 »

  1.   

    <%@include file="/include/foot.jsp"%>
    <%@include file="/include/fc_head.jsp"%>
    会不会是找不到上面两个页面 导致404异常 所以再次引用index.jsp页面 所以打印了多次1111111111
      

  2.   

    问题补充,就只有首页会出现这个问题,我把index.jsp改名成index1.jsp通过http://localhost:8080/index1.jsp访问就正常了。为啥呢?
      

  3.   

    而且在平常的写web工程的工程中也发现:
    访问同一个页面用IE和firfox
    发现打印出来的sql语句为
    IE: 1次
    firfox: 2次或以上。好像多访问了几次。遇到这样的问题真是百思不得其解。感觉这也太垃圾了
    看着这样的问题,就想把电脑砸的细碎细碎的
      

  4.   

    <%
    System.out.println("1111111111111111111111");
    %>
    这个,你放在<link>标签下面试试
      

  5.   

    莫名其妙的问题,我建议把work目录清空下,rebuild下,再看看
      

  6.   

    可能是filter没配置好,LZ自己检查下,这问题应该不是很难。