Reputation: 5987
My web application is on following address:
http://localhost:8080/MyProject/page-obj.html
I am calling Mule Project, from a Web Application(deployed on glassfish), having following URL in page:
`<form action="http://localhost:28146/CallObject" method="post" id="objform">`
Mule project is executing something on remote server and returning Success.
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
. Secondly, i am unable to load CSS and JS properly. I think i am not handling this properly
Following is Mule Flow in use:
`
<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>`
Upvotes: 0
Views: 978
Reputation: 2386
Have your Mule flow set redirect headers in the success case and the browser should follow the redirect:
<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>
Upvotes: 1