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