2 qq 28003739 qq_28003739 于 2016.04.08 15:26 提问

springmvc写的毕业设计,然后出现重复请求的现象,确认不是浏览器问题

如下图,红框中的地址首页地址,重复请求**三次以上**,次数不确定。求大神帮忙
图片说明
下面贴上web.xml和springmvc的配置

springmvc.xml


    <!-- 容器默认的DefaultServletHandler处理 所有静态内容与无RequestMapping处理的URL -->
    <mvc:default-servlet-handler />

<!--    <import resource="applicationContext.xml" /> -->
    <context:annotation-config />
    <!-- 对web包中的所有类进行扫描,以完成bean的创建和自动依赖注入功能 -->
    <context:component-scan base-package="com.junzhong"  >
        <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> 
        <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" /> 
    </context:component-scan>
    <mvc:annotation-driven />


    <!-- 定义无需Controller的url<->view直接映射 -->
<!--    <mvc:view-controller path="/" view-name="redirect:/main/index" /> -->


    <!-- 对模型视图的名称的解析 -->
    <bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass"
            value="org.springframework.web.servlet.view.JstlView"></property>
        <!-- 指定了表示层的前缀 这个配置是配置JSP页面的位置,按照你自己的配置来配 -->
        <property name="prefix" value="/WEB-INF/page/"></property>
        <!-- 指定了表示层的后缀 -->
        <property name="suffix" value=".jsp"></property>
    </bean>

    <bean id="multipartResolver"
        class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <!--one of the properties available;the maximum upload size in bytes 100M -->
        <property value="104857600" name="maxUploadSize" />
    </bean>


web.xml

 <welcome-file-list>
        <welcome-file>main/index</welcome-file>
    </welcome-file-list>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:spring/*.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <!-- spring-session -->
    <filter>
        <filter-name>spring-session</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        <init-param>
            <param-name>targetBeanName</param-name>
            <param-value>springsession</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>spring-session</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <listener>
        <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>
    <session-config>
        <session-timeout>1440</session-timeout>
    </session-config>

    <servlet>
        <servlet-name>wuhuan-frontend</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring/springmvc.xml</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>wuhuan-frontend</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>


    <!-- socket的映射 -->
    <!-- <servlet-mapping> -->
    <!-- <servlet-name>wuhuan</servlet-name> -->
    <!-- <url-pattern>/socketMsg/*</url-pattern> -->
    <!-- </servlet-mapping> -->
    <!-- <servlet-mapping> -->
    <!-- <servlet-name>wuhuan</servlet-name> -->
    <!-- <url-pattern>/socketMsg/sockjs/*</url-pattern> -->
    <!-- </servlet-mapping> -->


    <error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/common/500.jsp</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/common/500.jsp</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/common/404.jsp</location>
    </error-page>
    <error-page>
        <error-code>403</error-code>
        <location>/common/403.jsp</location>
    </error-page>

3个回答

qq_28003739
qq_28003739   2016.04.23 22:55
已采纳

自己最后解决了,原因是我之前有图片没有弄上,用#号代替的,结果它也进行网络请求了

Bush_nanjing
Bush_nanjing   2016.04.09 15:05

用了火狐吗? 火狐里面有个迅雷插件右键关系

qq_28003739
qq_28003739 应该不是,火狐访问百度等其他网站都不是这样的,而且我用ie打开也是的
一年多之前 回复
Bush_nanjing
Bush_nanjing   2016.04.09 15:06

用了火狐吗? 火狐里面有个迅雷插件右键关系

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!