我有一个命令按钮(特定的取消按钮),我想绕过页面上某些组件的验证.当我在命令按钮上设置了immediate ="true"时,更新属性不起作用.通过"不工作"我的意思是:centerForm:p_definition上的值不会重置为它们应该是什么.如果我从下拉列表中选择一个项目或将数据输入到输入文本中,则单击取消时该信息将消失.设置immediate ="false"或完全关闭它会按预期重置字段.这是我遇到问题的命令按钮的定义.
<p:commandButton value="Cancel" style="float: right;"
immediate="true"
actionListener="#{manageBomPropHandler.doCancel()}"
update=":centerForm:p_definition"/>
Run Code Online (Sandbox Code Playgroud)
这是立即="真"的预期行为吗?如果是这样,你如何解决这个取消按钮?
有没有办法让API Kit Router验证传入模式?我在我的RAML文件中有以下内容,但它不验证传入的架构.
- emails: |
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type" : "object",
"properties" : {
"email" : {
"type" : "string"
},
"name" : {
"type" : "string"
},
"emailOrigin" : {
"type" : "string"
}
}
}
resourceTypes:
- postbase:
post:
responses:
200:
body:
application/json:
500:
body:
application/json:
- putBase:
put:
responses:
200:
body:
application/json:
500:
body:
application/json:
/emails:
type: postbase
post:
description: |
Recieve emails captured from various parts of the site.
body:
schema: emails
Run Code Online (Sandbox Code Playgroud) 我试图使用选择路由器根据其路径处理HTTP消息.这很有效,直到我遇到使用PUT方法提交消息并且路径的尾部是customerID的情况.所以我有一条类似于此的路径:services/v1/customer/{custNo}.在选择路由器我有:
<choice doc:name="Route Message By Path">
<when expression="message.inboundProperties['http.relative.path'] == 'services/v1/users'">
<flow-ref name="NewUser" doc:name="New User"/>
</when>
<when expression="message.inboundProperties['http.relative.path'] == 'services/v1/users/{userID}'">
<flow-ref name="UpdateUser" doc:name="Update User"/>
</when>
<when expression="message.inboundProperties['http.relative.path'] == 'services/v1/emails'">
<flow-ref name="CaptureEmail" doc:name="Capture Email"/>
</when>
<when expression="message.inboundProperties['http.relative.path'] == 'services/v1/taxes'">
<flow-ref name="Taxes" doc:name="Taxes"/>
</when>
<otherwise>
<logger message="The path submitted is unknown. Submitted path is: #[message.inboundProperties['http.relative.path']]" level="INFO" doc:name="Unknown path"/>
<set-payload value="The path submitted is unknown. Submitted path is: #[message.inboundProperties['http.relative.path']]" doc:name="Set Payload"/>
<http:response-builder status="500" contentType="text/plain" doc:name="HTTP Response Builder"/>
</otherwise>
</choice>
Run Code Online (Sandbox Code Playgroud)
我有这个工作使用休息和注释的Java类,但我宁愿保持简单,并在骡子组件,如果我可以.有没有办法在MEL中为路由器添加通配符?此外,如果继续使用选择路由器,是否有一种从路径中提取客户编号的好/简单方法?
看起来这应该很简单,但解决方案一直在逃避我.我的流程是XML - > XSLT转换 - >使用Web服务(IBM Web Sphere Web Service是特定的).我有单独的工作但我无法弄清楚如何将用户/传递添加到SOAP标头.我认为我应该能够将它们添加到Mule SOAP组件的安全选项卡中的键(我将操作设置为Proxy Client).不幸的是,我无法弄清楚有效密钥是什么.也许我甚至试图使用安全选项卡离开基地.所以最终我需要我的传出XML包含:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1">
<wsse:UsernameToken>
<wsse:Username>
myUserName
</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">
myPa33W0rd
</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
Run Code Online (Sandbox Code Playgroud)
目前我的Mule流程正在推出:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
Run Code Online (Sandbox Code Playgroud)
我是否需要手动添加安全信息(可能在XSLT翻译中)?这感觉不对,但我无法弄清楚如何添加它.
以下是我的流程中的相关行:
<mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="src\main\resources\MappingMapToChangeCatalogEntry.xslt" outputEncoding="US-ASCII" doc:name="XSLT"/>
<cxf:proxy-client payload="body" enableMuleSoapHeaders="true" doc:name="SOAP"/>
<byte-array-to-string-transformer doc:name="Byte Array to String"/>
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用json-to-xml-transformer将json消息转换为xml,但无法找到有关其用法的文档。我不需要任何数据转换,只需将json属性转换为xml标签即可。当我尝试使用转换器时,我得到的只是json中的第一个元素。
输入JSON:
{
"site":"mysite",
"erpCustno":"123",
"shipToState":"PA",
"shipToZip":"16684",
"lineInfo": [
{
"lineNumber": "10",
"product": "MAT203"
}
]
}
Run Code Online (Sandbox Code Playgroud)
XML输出:
<?xml version='1.0'?><site>mysite</site>
Run Code Online (Sandbox Code Playgroud)
流:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.5.0"
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-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
<flow name="newpigrestFlow1" doc:name="newpigrestFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8087" doc:name="HTTP"/>
<json:json-to-xml-transformer mimeType="text/xml" doc:name="JSON to XML" ignoreBadInput="true"/>
</flow>
</mule>
Run Code Online (Sandbox Code Playgroud)
转换器是否需要映射类,还是可以将JSON直接转换为XML(反之亦然,使用xml-to-json-transformer)?
我正在使用Anypoint Studio 2014年7月并部署到Mule EE 3.5.0。
mule ×4
mule-studio ×2
cxf ×1
jsf-2 ×1
json ×1
mule-el ×1
primefaces ×1
raml ×1
soap ×1
websphere ×1