2016-07-06 50 views
0

我注意到,Spring集成在元素「入站網關」使用屬性「路徑」,作爲報告的文檔中的元素「入站網關」:Spring集成HTTP:不一致的屬性「路徑」爲

http://docs.spring.io/spring-integration/reference/html/http.html#_request_mapping_support

但在HTTP一體化XSD的「路徑」屬性不存在:

http://www.springframework.org/schema/integration/http/spring-integration-http.xsd 

<xsd:element name="inbound-gateway"> 
    <xsd:complexType> 
     <xsd:annotation> 
      <xsd:documentation>Defines an inbound HTTP-based Messaging Gateway.</xsd:documentation> 
     </xsd:annotation> 
     <xsd:complexContent> 
      <xsd:extension base="gatewayType"> 
       <xsd:attribute name="name" type="xsd:string"/> 
       <xsd:attribute name="extract-reply-payload" type="xsd:string" default="true"/> 
       <xsd:attribute name="supported-methods" type="xsd:string"/> 
       <xsd:attribute name="view" type="xsd:string"> 
        <xsd:annotation> 
         <xsd:appinfo> 
          <tool:annotation kind="ref"> 
           <tool:expected-type type="org.springframework.web.servlet.View"/> 
          </tool:annotation> 
         </xsd:appinfo> 
        </xsd:annotation> 
       </xsd:attribute> 
       <xsd:attribute name="request-mapper" type="xsd:string"> 
        <xsd:annotation> 
         <xsd:appinfo> 
          <tool:annotation kind="ref"> 
           <tool:expected-type type="org.springframework.integration.http.InboundRequestMapper"/> 
          </tool:annotation> 
         </xsd:appinfo> 
        </xsd:annotation> 
       </xsd:attribute> 
       <xsd:attribute name="request-key" type="xsd:string"/> 
       <xsd:attribute name="reply-key" type="xsd:string"/> 
       <xsd:attribute name="reply-timeout" type="xsd:string"/> 
      </xsd:extension> 
     </xsd:complexContent> 
    </xsd:complexType> 
</xsd:element> 

這似乎是的「接受」的屬性列表:

name 
extract-reply-payload 
supported-methods 
view 
request-mapper 
request-key 
reply-key 
reply-timeout 

「path」屬性在定義中不存在。

的效果是我在應用程序的啓動有一個錯誤:

org.xml.sax.SAXParseException; lineNumber: 71; columnNumber: 53; cvc-complex-type.3.2.2: Attribute "path" is not allowed to appear in element "int-http:inbound-gateway". 

如此配置的「牽連」部分:

<int-http:inbound-gateway request-channel="receiveChannel" 
         path="/receiveGateway" 
         supported-methods="POST"/> 

這是不一致的! 也許丟失了一些東西?

回答

0

我不想通過互聯網搜索從Spring集成版本就表明XSD,但是這是真的夠老肯定是有存在path屬性在當前,許多以前的版本:

<xsd:attributeGroup name="inboundCommonAttributes"> 
    <xsd:attribute name="path" type="xsd:string"> 
     <xsd:annotation> 
      <xsd:documentation> 
       Comma-separated URI paths (e.g., /orderId/{order}). 
       Ant-style path patterns are also supported (e.g. /myPath/*.do). 
      </xsd:documentation> 
     </xsd:annotation> 
    </xsd:attribute> 

請考慮在Eclipse中啓用Spring Nature,讓它從項目中的jar中讀取XSD,而不是從Internet中讀取XSD。