问题描述
- 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>
解决方案
自己最后解决了,原因是我之前有图片没有弄上,用#号代替的,结果它也进行网络请求了
解决方案二:
用了火狐吗? 火狐里面有个迅雷插件右键关系
解决方案三:
用了火狐吗? 火狐里面有个迅雷插件右键关系
时间: 2024-10-21 21:48:22