2012-09-01 26 views
9

Uso la Suite 3 di Springsource Tools e sto cercando di implementare le intercettazioni. Questo è il codice e gli errori sono commentate:Il carattere jolly corrispondente è rigoroso, ma non è possibile trovare alcuna dichiarazione per l'elemento

servlet-context.xml

<?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" 
    xmlns:context="http://www.springframework.org/schema/context" 
    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-2.5.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 

<annotation-driven /> 

<resources mapping="/resources/**" location="/resources/" /> 

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

<beans:bean id="authInterceptor" class="com.bank.accounting.authentication.AuthInterceptor" /> 
<beans:bean id="authUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 

Errore imprevisto durante la definizione del chicco di analisi: problema di configurazione: Impossibile individuare BeanDefinitionParser per l'elemento [list]

<beans:property name="interceptors"> 
     <list> 

Il jolly di corrispondenza è rigoroso, ma non è possibile trovare alcuna dichiarazione per l'elemento ' elenco'.

  <ref bean="authInterceptor" /> 
     </list> 
    </beans:property> 
    <beans:property name="mappings"> 
     <props> 

Il jolly di corrispondenza è rigorosa, ma nessuna dichiarazione può essere trovato per 'oggetti di scena' elemento.

  <prop key="/home">HomeController</prop> 
     </props> 
    </beans:property> 
</beans:bean> 
<beans:bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 

errore imprevisto durante la definizione del chicco di analisi: problema di configurazione: Impossibile individuare BeanDefinitionParser per l'elemento [oggetti di scena]

<beans:property name="mappings"> 
     <props> 

Il jolly di corrispondenza è rigorosa, ma nessuna dichiarazione può essere trovato per elemento 'puntelli'.

  <prop key="/login">LoginController</prop> 
     </props> 
    </beans:property> 
</beans:bean> 
</beans:beans> 

risposta

33

<list> e <ref> tag appartengono a utilnamespace. Aggiungilo prima:

xmlns:util="http://www.springframework.org/schema/util" 
xsi:schemaLocation=" 
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd" 

E poi precedere queste dichiarazioni in modo appropriato:

<util:list> 
    ... 

Si può anche provare con <beans:util>.

+3

+1. Nel mio caso mi mancava la dichiarazione di schemaLocation. –

Problemi correlati