2014-02-05 64 views
0

我的Web应用程序在以下地址之间的通信:骡子 - Web应用程序和Mule ESB

http://localhost:8080/MyProject/page-obj.html

我打电话骡子项目,从Web应用程序(部署在GlassFish),其以下URL中的页面:

`<form action="http://localhost:28146/CallObject" method="post" id="objform">` 

Mule项目正在执行远程服务器上的东西,并返回成功。

我要成功重定向到另一个页面say

http://localhost:8080/MyProject/page-sucess.html

When重定向我看到了http://localhost:28146/CallObject地址栏而不是http://localhost:8080/MyProject/page-sucess.html,其次,我无法正确加载CSS和JS。我想我不会处理这个正确

使用以下是骡子流量:

`

<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>` 

回答

1

有你的骡流设置在成功的情况下重定向报文头和浏览器应遵循的重定向:

<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> 
+0

它抛出错误:属性不允许为孩子HTTP的元素。 – fatherazrael

+0

我纠正了我的例子。您应该使用set-property元素而不是属性。 – neildo

+0

它也在Custom Transformer周围没有。我想我应该删除,因为我无法看到任何用法 – fatherazrael