[英]Mule - Communication between Web application and Mule ESB
My web application is on following address: 我的Web应用程序位于以下地址:
http://localhost:8080/MyProject/page-obj.html
I am calling Mule Project, from a Web Application(deployed on glassfish), having following URL in page: 我正在从Web应用程序(部署在glassfish上)调用Mule Project,并在页面中具有以下URL:
`<form action="http://localhost:28146/CallObject" method="post" id="objform">`
Mule project is executing something on remote server and returning Success. Mule项目正在远程服务器上执行某些操作并返回成功。
I want to redirect success to another page say 我想将成功重定向到另一页说
http://localhost:8080/MyProject/page-sucess.html
When redirect, i see http://localhost:28146/CallObject
on address bar, instead of http://localhost:8080/MyProject/page-sucess.html
. 重定向时,我在地址栏上看到
http://localhost:28146/CallObject
,而不是http://localhost:8080/MyProject/page-sucess.html
。 Secondly, i am unable to load CSS and JS properly. 其次,我无法正确加载CSS和JS。 I think i am not handling this properly
我认为我处理不当
Following is Mule Flow in use: 以下是正在使用的M子流:
` `
<http:endpoint exchange-pattern="request-response" address="http://localhost:8080/MyProject/page-sucess.html" name="page" method="POST"/>
<flow name="Create_Work_Flow" doc:name="Create_Work_Flow">
<http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:28146/CallObject" contentType="text/html" doc:name="Request">
<http:body-to-parameter-map-transformer doc:name="HTMLForm-Parameters-To-Mule"/>
</http:inbound-endpoint>
<logger level="INFO" doc:name="Form-Parameters" message="#[payload]" />
<http:outbound-endpoint exchange-pattern="request-response" method="POST" doc:name="HTTP" ref="Page">
<custom-transformer class="com.ExecuteWorkflow" doc:name="Call-CreateWorkflow"/>
</http:outbound-endpoint>
</flow>`
Have your Mule flow set redirect headers in the success case and the browser should follow the redirect: 在成功的情况下,让您的Mule流设置重定向头,浏览器应遵循重定向:
<flow name="Create_Work_Flow" doc:name="Create_Work_Flow">
<http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:28146/CallObject" contentType="text/html" doc:name="Request">
<http:body-to-parameter-map-transformer doc:name="HTMLForm-Parameters-To-Mule"/>
</http:inbound-endpoint>
<logger level="INFO" doc:name="Form-Parameters" message="#[payload]" />
<http:outbound-endpoint exchange-pattern="request-response" method="POST" doc:name="HTTP" ref="Page">
<custom-transformer class="com.ExecuteWorkflow" doc:name="Call-CreateWorkflow"/>
</http:outbound-endpoint>
<set-property propertyName="http.status" value="301"/>
<set-property propertyName="Location" value="http://localhost:8080/MyProject/page-
</flow>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.