当前位置:编程学习 > JAVA >>

Sping中</mvc:interceptors>报错

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" 
xmlns:util="http://www.springframework.org/schema/util" 
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
        http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd  ">

......
        ......
        ......

<mvc:interceptors>
<bean class="com.sunyard.lmas.common.RightInterceptor" />
</mvc:interceptors>
        
        ......
</beans>

MyEclipse上面报错,


求大神分析下,是上面错误啊。 myeclipse spring mvc <mvc:interceptors> --------------------编程问答-------------------- 是不是拷贝代码的时候,把配置合并重复了 --------------------编程问答-------------------- <mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/*"/>
<bean class="com.jianglong.interceptor.SystemInterceptor"></bean>
</mvc:interceptor>
</mvc:interceptors>

应该是这样的吧
<mvc:interceptors>标签下是不是应该包含<mvc:interceptor>?之后才是bean标签吧。。。 --------------------编程问答-------------------- <?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:context="http://www.springframework.org/schema/context" 
    xmlns:aop="http://www.springframework.org/schema/aop" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-3.0.xsd 
http://www.springframework.org/schema/tx 
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd 
http://www.springframework.org/schema/aop 
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
">



<!-- 自动扫描目录 --> 
    <context:component-scan base-package="com.jianglong.test" /> 
    <context:component-scan base-package="com.jianglong.company.security.login" /> 
    <context:component-scan base-package="com.jianglong.company.security.module" /> 
    <context:component-scan base-package="com.jianglong.company.security.role" /> 
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>
    
    <!-- 定义视图 -->
    <bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  <property name="prefix">
  <value>/</value>
  </property>
  <property name="suffix">
  <value>.jsp</value>
  </property>
    </bean>
<!-- <mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/*"/>
<bean class="com.jianglong.interceptor.SystemInterceptor"></bean>
</mvc:interceptor>
</mvc:interceptors> -->
</beans>

也可能是dtd丢了点什么 我这儿有完整的 你看看
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,