我在屬性文件中有一個(gè)密碼com.password=$&m它被插入到 sftp 駱駝路由中{{com.password}},我得到了"Unknown parameters=[{m=}]"& 被錯(cuò)誤地解釋。我嘗試了一些方法,但在文檔中找不到任何內(nèi)容。我該怎么做才能讓它逐字使用密碼?編輯:<cm:property-placeholder id="blueprint.placeholder" persistent-id="com.props" ></cm:property-placeholder>路線:<camel:route id="uploadqueue"> <camel:from uri="file://{{com.dir}}/?antInclude=*.xml&delay=10000&move=processed/${file:name}&moveFailed=error/${file:name}" /> <camel:to uri="log:input?showAll=true&level=INFO"/> <camel:to uri="sftp://192.168.0.1/?username={{com.user}}&password={{com.password}}" /></camel:route>編輯:現(xiàn)在路線: <camel:to uri="sftp://192.168.0.1/?username={{com.user}}&password=RAW({{com.password}})" />堆棧跟蹤。出于保密原因略有編輯,但基本上就是這樣。$&m 的密碼被解釋為 $ 的 HTML (%24),即密碼,& 作為語(yǔ)義與符號(hào),m 作為新參數(shù)。即 RAW() 什么也沒(méi)做。Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: sftp://192.168.0.1/?password=%24&m=&username=USERNAME due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{m=}] at org.apache.camel.impl.DefaultComponent.validateParameters(DefaultComponent.java:215) ~[?:?] at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:139) ~[?:?] at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:711) ~[?:?] at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:80) ~[?:?] at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:219) ~[?:?] at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:115) ~[?:?] at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:121) ~[?:?]
駱駝從屬性文件中轉(zhuǎn)義特殊字符
ibeautiful
2023-10-13 09:47:28