Skip to content

External redirection in SWF

September 25, 2009
tags:

This information is dealing with how to redirect to an external URL conditionally – where in the url generated is a dynamic URL.

If in any method of FormAction extended class you need to redirect to an external url then either you can do it through as follows:

ServletExternalContext sec = ((ServletExternalContext)context.getExternalContext());
sec.getResponse().sendRedirect("http://www.google.com");
context.getFlowScope().put("myparam","paramValue");

Or you can create a link between the return type of the Action method which returns an Event. Create your own custom Event as follows:

getEventFactorySupport().event(this,"registerRedirect");

and in the file webflow.xml create an end point:

<transition on="registerRedirect" to="viewRedirectView" />
<end-state id="viewRedirectView" view="externalRedirect:http://www.google.com?param=${flowScope.myparam}" />
Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: