2017-10-19 36 views
0

私は基本的な春のWeb動的プロジェクトを作成しようとしています。
以下は、春のライブラリリストです。
enter image description here要素 'beans'の宣言が見つかりません。春に

これは私のHelloWeb-servlet.xmlコードです。

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_4.0.xsd" 
     bean-discovery-mode="annotated"> 
    <context:component-scan base-package = "com.tutorialspoint" /> 
    <bean class = "org.springframework.web.servlet.view.InternalResourceViewResolver"> 
     <property name = "prefix" value = "/WEB-INF/jsp/" /> 
     <property name = "suffix" value = ".jsp" /> 
    </bean> 
</beans> 


そして、ここに私のプロジェクト構造です。 enter image description here

私を助けてください。ありがとうございました。

+0

xmlnsが奇妙に見えますが、通常は別のものですhttps://stackoverflow.com/questions/17822466/spring-beans-dtd-and-xmlnsたとえば –

+0

@RCここで変更する必要があります –

答えて

0

HelloWeb-servlet.xmlをこれに変更しました。

<beans xmlns = "http://www.springframework.org/schema/beans" 
    xmlns:context = "http://www.springframework.org/schema/context" 
    xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation = "http://www.springframework.org/schema/beans  
    http://www.springframework.org/schema/beans/spring-beans-4.0.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-4.0.xsd"> 

    <context:component-scan base-package = "com.tutorialspoint" /> 

    <bean class = "org.springframework.web.servlet.view.InternalResourceViewResolver"> 
     <property name = "prefix" value = "/WEB-INF/jsp/" /> 
     <property name = "suffix" value = ".jsp" /> 
    </bean> 

</beans> 

現在作業中です。

関連する問題