Question

I have a Java Spring Webflow application and it need to redirect to it's own sub domain for language choice. i.e. mysite.com to fr.mysite.com.

I have tried externalRedirect, but just shows a blank html page.

Here is the webflow defenition snippet:

<transition on="found" to="redirectOnRetrieve">         
    <evaluate expression="retrieveController.getFoundApplicationRedirect(flowRequestContext)" result="flowScope.redirectUrl"/> 
</transition>

Which determines the URL I need to redirect to. And the following is the view state with the externalRedirect:

<view-state id="redirectOnRetrieve" view="externalRedirect:${flowScope.redirectUrl}"/>

Is it also possible to append request parameters to the URL?

Was it helpful?

Solution

I managed to achieve what I was after. Doing a redirect to a subdomain within a webflow. So this is how I managed to get it working.

So in the flow definition I have:

<transition on="found" to="redirectOnRetrieve">         
    <evaluate expression="retrieveController.brokerApplicationRedirect(flowRequestContext)"/> 
</transition>

Now, I did the redirect with in the retrieveController:

   public void brokerApplicationRedirect(RequestContext context) throws IOException, ServletException {
        String urlString = "http://sub.domain.com?param=myparam";        
        context.getExternalContext().requestExternalRedirect(urlString);
    }

So I build up the Url string any way I want then did the redirect within the controller.

OTHER TIPS

Within flow.xml, the correct EL syntax is #{flowScope.redirectUrl} rather than ${flowScope.redirectUrl}.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top