我敢扶老奶奶 2021-04-13 16:04 采纳率: 100%
浏览 1663
已采纳

报错[http-nio-8080-exec-6]

我新添加了一个billcontroller后发现好像mvc无法识别报错,其他页面访问正常,百度了很多,注解和web配置都是没错的呀,新添加的这个注解什么的都加了,没有问题
查询数据库也可查出来,真得不知道是哪里有问题,在线等。。。。
具体错误:点订单管理报错404.其他功能正常

控制台报错:

报错


 

controller层

web.xml
 

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
  <display-name>Archetype Created Web Application</display-name>
  <!--乱码过滤器-->
  <filter>
    <filter-name>encode</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>
  </filter>
  <filter-mapping>
    <filter-name>encode</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <!--MVC配置文件-->
  <servlet>
    <servlet-name>mvc</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:spring-*.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>mvc</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
</web-app>

spring-mvc.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:content="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
         http://www.springframework.org/schema/mvc
         http://www.springframework.org/schema/mvc/spring-mvc.xsd">
    <content:component-scan base-package="cn.smbms"/>
    <!--转换器 解决返回对象时候 乱码 和 日期样式-->
    <!--<bean class="org.springframework.context.support.ConversionServiceFactoryBean" id="conversionService2">
        <property name="converters">
            <bean class="cn.smbms.converts.StringToDateConvert" id="stringToDateConvert"/>
        </property>
    </bean>-->
    <!--conversion-service=""-->
    <mvc:annotation-driven>
        <mvc:message-converters>
            <!--配置消息转换器-->
            <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                <property name="supportedMediaTypes">
                    <list>
                        <value>application/json;charset=UTF-8</value>
                    </list>
                </property>
            </bean>
            <!--时间戳-->
            <bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter"
                  id="fastJsonHttpMessageConverter">
                <property name="supportedMediaTypes">
                    <list>
                        <value>application/json;charset=UTF-8</value>
                        <value>text/html;charset=UTF-8</value>
                    </list>
                </property>
                <property name="features">
                    <list>
                        <value>WriteDateUseDateFormat</value>
                    </list>
                </property>
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>
    <bean class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean" id="bean">
        <property name="favorParameter" value="true"/>
        <property name="mediaTypes">
            <props>
                <prop key="html">text/html;charset=UTF-8</prop>
                <prop key="json">application/json;charset=UTF-8</prop>
                <prop key="xml">application/xml;charset=UTF-8</prop>
            </props>
        </property>
    </bean>
    <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver" id="negotiatingViewResolver">
        <property name="contentNegotiationManager" ref="bean"/>
        <property name="viewResolvers">
            <list>
                <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
                    <property name="prefix" value="/WEB-INF/jsp/"/>
                    <property name="suffix" value=".jsp"/>
                </bean>
            </list>
        </property>
    </bean>
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" id="viewResolver">
        <property name="prefix" value="/WEB-INF/jsp/"/>
        <property name="suffix" value=".jsp"/>
    </bean>
    <mvc:resources mapping="/css/**" location="/css/"/>
    <mvc:resources mapping="/images/**" location="/images/"/>
    <mvc:resources mapping="/js/**" location="/js/"/>
    <mvc:resources mapping="/calendar/**" location="/calendar/"/>
    <!--全局异常处理-->
    <bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
        <property name="exceptionMappings">
            <props>
                <prop key="java.lang.RuntimeException">error</prop>
            </props>
        </property>
    </bean>
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <property name="maxUploadSize" value="5000000"/>
        <property name="defaultEncoding" value="UTF-8"/>
    </bean>
    <!--拦截器-->
    <mvc:interceptors>
        <mvc:interceptor>
            <!--拦截的请求-->
            <mvc:mapping path="/**"/>
            <!--排除的请求-->
            <mvc:exclude-mapping path="/"/>
            <mvc:exclude-mapping path="/login.do"/>
            <mvc:exclude-mapping path="/images/**"/>
            <mvc:exclude-mapping path="/js/**"/>
            <mvc:exclude-mapping path="/css/**"/>
            <mvc:exclude-mapping path="/calendar/**"/>

            <bean class="cn.smbms.intercept.Sysintercept" id="sysintercept"/>
        </mvc:interceptor>
    </mvc:interceptors>
    
</beans>


 

  • 写回答

6条回答 默认 最新

  • 关注

    相对路径的问题,请采纳,谢谢!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的