Pergunta

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

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top