문제

I have a trouble with <mvc:annotation-driven />. I would like to use for JSR-303 annotation.

Check this image. http://s7.postimg.org/cz7itmiuj/Beze_jm_na.png

도움이 되었습니까?

해결책

Try adding an xmlns:mvc="http://www.springframework.org/schema/mvc attribute as well as adding http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd within the xsi:schemaLocation of your opening beans element.

Something like:

<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"
   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">

Obviously, keep the additional namespaces that you have in your current configuration that you're using but are not in the sample above, such as the xmlns:jee if you need it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top