Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<mvc:resources> type not resolved

I am trying to build the mvc-showcase example available here link.

But i am getting the below error:

cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'resources'.

Source code of servlet-context.xml is

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:beans="http://www.springframework.org/schema/beans"
   xsi:schemaLocation="
       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

    <!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->

    <!-- Enables the Spring MVC @Controller programming model -->
    <annotation-driven conversion-service="conversionService" />

    <!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources/ directory -->
    <resources mapping="/resources/**" location="/resources/" />

    <!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
    <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <beans:property name="prefix" value="/WEB-INF/views/" />
        <beans:property name="suffix" value=".jsp" />
    </beans:bean>

    <!-- Imports user-defined @Controller beans that process client requests -->
    <beans:import resource="controllers.xml" />

    <!-- Only needed because we install custom converters to support the examples in the org.springframewok.samples.mvc.convert package -->
    <beans:bean id="conversionService" class="org.springframework.samples.mvc.convert.CustomConversionServiceFactoryBean" />

    <!-- Only needed because we require fileupload in the org.springframework.samples.mvc.fileupload package -->
    <beans:bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />   
</beans:beans> 

NOTE: I am using Eclipse IDE and i am using spring 3.0.4 version(because i am using the same pom.xml given in the project link)

like image 489
javanoob Avatar asked May 10 '26 20:05

javanoob


1 Answers

The tag is a new feature in Spring Framework 3.0.4, so check your spring version.

Cheers

like image 200
Drolyk Avatar answered May 13 '26 13:05

Drolyk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!